读取plist:
// 获取文件路径。
NSString *path = [[NSBundle mainBundle] pathForResource:@"plistDemo" ofType:@"plist"];
// 读取文件
NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
NSLog(@"%@", data);
写plist:
// 沙盒的目录
NSArray *documentPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
//得到文件绝对路径
NSString *filePath = [[documentPath objectAtIndex:0] stringByAppendingPathComponent:@"plistDemo.plist"];
//写入文件
[data writeToFile:filePath atomically:YES];