plist文件读写
来源:互联网 发布:跳跃网络账号重设 编辑:程序博客网 时间:2024/05/16 07:51
- (void)viewDidLoad{ [super viewDidLoad]; NSDictionary *dictionary1 = [NSDictionary dictionaryWithObjectsAndKeys:@"1",@"a",@"2",@"b", nil]; NSDictionary *dictionary2 = [NSDictionary dictionaryWithObjectsAndKeys:@"3",@"c",@"4",@"d", nil]; // 获取应用程序沙盒的Documents目录 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES); NSString *plistPath = [paths objectAtIndex:0]; // plist文件完整路径 NSString *filename=[plistPath stringByAppendingPathComponent:@"test.plist"]; // *写入(原有数据被覆盖) [dictionary1 writeToFile:filename atomically:YES]; [dictionary2 writeToFile:filename atomically:YES]; // *读取 NSDictionary *dic = [[NSMutableDictionary alloc] initWithContentsOfFile:filename]; NSLog(@"%@", dic);}
结论:重复对同一plist写入数据,后一次写入的数据将覆盖前一次写入的数据。
- iphone读写plist文件
- NSDictionary 读写 plist 文件
- AppleScript 读写plist文件
- plist文件读写操作
- plist文件的读写
- plist文件读写
- plist文件的读写
- plist文件的读写
- plist文件读写
- Python_python读写plist文件
- plist文件读写
- plist文件的读写
- IOS 读写plist文件
- 读写plist文件
- plist文件读写
- ios plist文件读写
- plist文件读写
- 读写plist文件
- ios程序发布后,收集Crash崩溃信息
- 判断 iPhone 是否已插入 SIM 卡的方法
- javascript Date format(js日期格式化)
- LeetCode_Jump Game II
- Shell split character line by line
- plist文件读写
- 桌面程序开发之旅
- 思科工业以太网指南
- android 瀑布流效果(仿蘑菇街)
- 清除arcsde空间垃圾数据以及解决sde图层名称被占用的问题
- CSipSimple--简介
- ubuntu11.10中如何安装 *.so 文件
- 第二章 构造高效且健壮的网络程序(二)
- hdu 1159 common subsuquence