- (void)viewDidLoad
{
//NSMutableData *data;
NSFileManager *fm = [NSFileManager defaultManager];
NSString *path = [fm currentDirectoryPath];
//NSArray *dirarray;
infile_ = [NSFileHandle fileHandleForReadingAtPath:@"/jia"];
NSMutableString *string = [[NSMutableString alloc]init];
if (infile_ != nil) {
NSMutableArray *temparray = [[NSMutableArray alloc]init];
while ([infile_ offsetInFile] == [infile_ seekToEndOfFile])
{
NSData *tempdata = [infile_ readDataOfLength:1];
string = (NSMutableString *)tempdata;
//[data appendData:tempdata];
[temparray addObject:string];
//data = nil;
}
self.array = temparray;
}
else
{
//dirarray = [fm directoryContentsAtPath:path];
text_.text = path;
}
[super viewDidLoad];
}
{
//NSMutableData *data;
NSFileManager *fm = [NSFileManager defaultManager];
NSString *path = [fm currentDirectoryPath];
//NSArray *dirarray;
infile_ = [NSFileHandle fileHandleForReadingAtPath:@"/jia"];
NSMutableString *string = [[NSMutableString alloc]init];
if (infile_ != nil) {
NSMutableArray *temparray = [[NSMutableArray alloc]init];
while ([infile_ offsetInFile] == [infile_ seekToEndOfFile])
{
NSData *tempdata = [infile_ readDataOfLength:1];
string = (NSMutableString *)tempdata;
//[data appendData:tempdata];
[temparray addObject:string];
//data = nil;
}
self.array = temparray;
}
else
{
//dirarray = [fm directoryContentsAtPath:path];
text_.text = path;
}
[super viewDidLoad];
}
解决方案 »
- .net也可以开发Android和iOS程序了!已经成为事实!
- 能把UISegmentedControl的布局改为2*3的吗?
- 求助:如何接收推送信息?
- 请各位高手帮忙:文件网际传输除了用Socket底层解决?还有别的方法吗?拜谢
- 如何配置app在itunes里的图标
- ASIHttprequest 在自定义类中不执行回调函数
- iOS开发,大致可以分多少类?
- GCDAsyncSocket类TCP连接发送数据粘包怎么办
- UICollectionView显示图片排列不齐
- 给UIButton绑定点击事件无响应
- iphone有安装文件(如ipa)的解包工具吗?
- SVN下xcode里的工程配置文件的问题。
另外,我找了一段相关的代码: NSString *path = [[NSBundle mainBundle] pathForResource:@"webViewContent" ofType:@"html"];
NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path];