iPhone开发 读取plist中的值
来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 20:08 点击:次
//获取文件路径
NSString *path = [[NSBundlemainBundle] pathForResource:@"user.plist"ofType:@""];
//获取数据
NSMutableDictionary* dict = [ [ NSMutableDictionaryalloc ] initWithContentsOfFile:path ];
NSString* object = [ dict objectForKey:@"aaa" ];
NSLog(object);
摘自 凡娃软件
//修改数据
NSMutableDictionary* dict = [ [ NSMutableDictionaryalloc ] initWithContentsOfFile:path ];
[ dict setObject:textview.text forKey:@"bbb" ];
[ dict writeToFile:path atomically:YES ];
相关新闻>>
- 发表评论
-
- 最新评论 更多>>