Plist文件的读写
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
//获取文件的路径
NSString * path=[[NSBundle mainBundle]pathForResource:@"Info" ofType:@"plist"];
//获取文件的内容
NSDictionary * dic=[NSDictionary dictionaryWithContentsOfFile:path];
NSLog(@"%@",dic);
//写入内容
NSMutableDictionary * mDic=[NSMutableDictionary dictionaryWithDictionary:dic];
[mDic setObject:@"hehe" forKey:@"name"];
[mDic writeToFile:path atomically:YES];
//获取沙盒路径
//根目录
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end