摘要: 4月1日 文件操作4月2日 内存管理 阅读全文
posted @ 2014-04-01 23:39 太过于漂流 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 1. // 创建读取的文件操作柄 NSFileHandle *inFile=[NSFileHandle fileHandleForReadingAtPath:@"/Users/haiyefeng/Desktop/text1.txt"]; if(inFile==nil) { NSLog(@"打开文件失败!"); return 1; } else { NSLog(@"打开文件成功!"); } ... 阅读全文
posted @ 2014-04-01 16:33 太过于漂流 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 1.文件目录操作 // 1.创建文件操作对象fm,并打印出当前目录 NSFileManager *fm=[NSFileManager defaultManager]; // 获取当前目录 NSLog(@"当前目录:%@",[fm currentDirectoryPath]); ///2014-04-01 13:58:20.523 NSFileManager[1161:303] 当前目录:/Users/haiyefeng/Library/Developer/Xcode/DerivedData/NSFi... 阅读全文
posted @ 2014-04-01 14:39 太过于漂流 阅读(816) 评论(0) 推荐(1) 编辑
摘要: // 创建文件操作对象 fm NSFileManager *fm=[NSFileManager defaultManager]; //将文件内容读取到内存缓冲区 NSString *fPathName=@"/Users/haiyefeng/Desktop/text1.txt"; NSData *myBuffer=[fm contentsAtPath:fPathName]; // 判断操作是否成功 if(myBuffer==nil) { ... 阅读全文
posted @ 2014-04-01 13:47 太过于漂流 阅读(281) 评论(0) 推荐(0) 编辑
摘要: NSFileManager文件操作-(NSData*) contentsAtPath: path从一个文件中读取数据-(bool)createFileAtPath:path contents:(NSData *)data attributes:attr创建一个文件并写入数据-(BOOL) removeItemAtPath: path error: err删除一个文件-(BOOL) moveItemAtPath: from toPath: to error: err重命名或移动一个文件-(BOOL) copyItemAtPath: from toPath: to error: err复制文件(目 阅读全文
posted @ 2014-04-01 13:34 太过于漂流 阅读(863) 评论(0) 推荐(0) 编辑