iOS plist文件操作
来源:互联网 发布:华为网络盒子支持4k吗 编辑:程序博客网 时间:2024/05/20 13:40
//写入plist文件:
NSArray*pathArray = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString*path = [pathArray objectAtIndex:0];
//获取文件的完整路径
NSString *filePatch = [pathstringByAppendingPathComponent:@"xiaoxi.plist"];
NSMutableArray *arr = [[NSMutableArrayalloc]init];
for (inti = 0; i < 10; i ++) {
NSDictionary *dic = [NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:@"sean%d",i],@"name",nil];
[arr addObject:dic];
}
[arr writeToFile:filePatchatomically:YES];
//读取plist文件的内容
// NSMutableDictionary *dataDictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:filePatch];
//获取文件的完整路径
NSString *filePatch = [pathstringByAppendingPathComponent:@"xiaoxi.plist"];
NSMutableArray *arr = [[NSMutableArrayalloc]init];
for (inti = 0; i < 10; i ++) {
NSDictionary *dic = [NSDictionarydictionaryWithObjectsAndKeys:[NSStringstringWithFormat:@"sean%d",i],@"name",nil];
[arr addObject:dic];
}
[arr writeToFile:filePatchatomically:YES];
//读取plist文件的内容
// NSMutableDictionary *dataDictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:filePatch];
NSMutableArray *arrp = [[NSMutableArrayalloc]initWithContentsOfFile:filePatch];
NSLog(@"---plist--%@",arrp);
0 0
- ios 操作plist文件
- iOS plist文件操作
- IOS plist文件操作
- iOS plist文件操作
- ios-plist文件读写操作
- ios-plist文件读写操作
- iOS plist 文件读写操作
- iOS中plist文件操作
- ios中对plist文件操作
- IOS plist文件的增删操作
- iOS plist文件读,写,增加操作
- IOS学习之plist文件的操作
- iOS plist文件的读写删操作
- iOS:plist读写操作
- 【iOS】操作plist
- plist文件操作总结
- plist文件读写操作
- plist文件操作
- redis采用序列化方案存对象
- Proteus入门教程
- Android跳转到微信公众号
- openSUSE下安装LAMP
- iOS中@Property声明的属性同时重写getter和setter方法报错问题
- iOS plist文件操作
- c#导出Excel文件,转换为可读模式
- Clang Language Extensions
- buntu虚拟机的共享文件夹
- 感悟爱情婚姻
- Fresco动态加载圆角(java代码实现)
- 发布环境下关闭NSLog
- Node.js初体验
- nagios|icinga 监控特定端口TCP连接数