标签:some ica oftype plist mask resource ict code ring
1 //读取plist文件的数据 2 NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"province" ofType:@"plist"]; 3 NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; 4 // NSLog(@"%@", data);//直接打印数据。 5 // NSLog(@"%ld",data.count); 6 7 8 //向plist文件写入。。。。。暂时只需要读,先不看。。。 9 //添加一项内容 10 // [data setObject:@"add some content" forKey:@"c_key"]; 11 // 12 // //获取应用程序沙盒的Documents目录 13 // NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES); 14 // NSString *plistPath1 = [paths objectAtIndex:0]; 15 // 16 // //得到完整的文件名 17 // NSString *filename=[plistPath1 stringByAppendingPathComponent:@"team.plist"]; 18 // //输入写入 19 // [data writeToFile:filename atomically:YES]; 20 // 21 // //那怎么证明我的数据写入了呢?读出来看看 22 // NSMutableDictionary *data1 = [[NSMutableDictionary alloc] initWithContentsOfFile:filename]; 23 // NSLog(@"%@", data1); 24 //
标签:some ica oftype plist mask resource ict code ring
原文地址:http://www.cnblogs.com/vector11248/p/7678407.html