plist --- 's read and write

来源:互联网 发布:我与网络演讲稿2000字 编辑:程序博客网 时间:2024/05/18 00:30

Create a .plist file named myPlist.

read code:

  NSBundle *bundle = [NSBundle mainBundle];    NSString *path = [bundle pathForResource:@"myPlist" ofType:@".plist"];    NSMutableDictionary *dic = [[NSMutableDictionary alloc]initWithContentsOfFile:path];    NSLog(@"content = %@",dic);

show:


write code:

[dic writeToFile:@"/tmp/demo.plist" atomically:YES];


0 0
原创粉丝点击