iphone 读写文件
来源:互联网 发布:华夏航空公司订票软件 编辑:程序博客网 时间:2024/05/22 17:58
- (void)readWritePlist:(BOOL)readonly{
//get the documents directory:
NSArray *paths =NSSearchPathForDirectoriesInDomains
(NSDocumentDirectory,NSUserDomainMask, YES);
NSString *documentsDirectory = [pathsobjectAtIndex:0];
//make a file name to write the data to using the
//documents directory:
NSString *fullFileName = [NSStringstringWithFormat:@"%@/arraydata.plist", documentsDirectory];
NSLog(@"fullFileName: %@",fullFileName);
//create an array and add values to it:
NSMutableArray *array = [[NSMutableArrayalloc] init];
[arrayaddObject:@"One"];
[arrayaddObject:@"Two"];
[arrayaddObject:@"Three"];
//this statement is what actually writes out the array
//to the file system:
[arraywriteToFile:fullFileName atomically:NO];
//retrieve the array contents.重新获取那个文件的内容
NSMutableArray *array2 = [[NSMutableArrayalloc] initWithContentsOfFile:fullFileName];
NSLog(@"readWritePlist: %@",array2);
[array2release];
- iPhone 文件读写
- iPhone 文件读写
- iphone读写plist文件
- 【转】 iPhone 文件读写
- iphone 文件读写
- iphone 读写文件
- iPhone 文件读写
- Iphone文件读写操作
- iPhone文件读写操作
- iPhone文件读写
- Iphone文件读写操作
- iPhone 文件读写操作
- iPhone 文件读写操作
- iphone开发 文件的读写
- iphone开发文件的读写
- iPhone文件读写系统操作
- iphone实现文件的读写操作
- 在iPhone上读写zip文件
- linux 的errno定义
- 《C++ Primer》经典语句(四)
- 关于浏览器响应鼠标各个按键的问题
- 第三周实验报告(任务三)
- 用函数实现两表连接
- iphone 读写文件
- 改善Details和Delete方法(ASP.NET MVC3系列文章九)
- Java程序员从笨鸟到菜鸟之(一)开发环境搭建,基本语法,字符串,数组
- Hibernate缓存机制
- linux 网卡配置
- JbossCache使用
- STM32F107VC简述
- URL
- hibernate一级缓存