①存储数据:
1.获得home路径:
NSString*home =NSHomeDirectory();
2.通过home路径获得Documents/xxx.plist路径
3.往相应的路径写数据
- -(IBAction)save:(id)sender{
- NSString*home=NSHomeDirectory();
- NSLog(@"%@",home);
- NSString*strDocument=[homestringByAppendingPathComponent:@"Documents/xml.plist"];
- NSArray*array=@[@"A",@"B",@"C"];
- [arraywriteToFile:strDocumentatomically:YES];
- }
②读取数据:
1.获得相应的plist文件的路径
copy