heji 发表于 2013-1-30 20:25:01

IOS中plist的读写操作

从项目中读plist文件
NSString *path = [ pathForResource:@"heji" ofType:@"plist"];NSMutableDictionary *mutableDictionary = [ initWithContentsOfFile:path];NSLog(@"%@", );NSLog(@"%@", [ objectForKey:@"d_1"]);NSLog(@"%@", [ objectForKey:@"d_2"]);NSLog(@"%@", [ objectForKey:@"d_3"]);NSLog(@"%@", );

在沙盒目录里创建并且读写
NSMutableDictionary *dic = [ init];;NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);NSString *myPath = ;NSString *realpath = ;;NSMutableDictionary *mutableDictionary1 = [ initWithContentsOfFile:realpath];NSLog(@"%@", );
页: [1]
查看完整版本: IOS中plist的读写操作