iphone 文件系统 读写document中的文件

1利用FileManage来读取document的文件

NSFileManager *fileManager = [NSFileManager defaultManager];  
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
NSError *error = nil;
NSArray *fileList = [[NSArray alloc] init];
fileList = [fileManager contentsOfDirectoryAtPath:documentsDirectory error:&error];
for (NSString *file in fileList) {
NSLog(@"fileName is :%@",file);
}

 

posted on 2011-12-07 11:28  wtq  阅读(319)  评论(0编辑  收藏  举报