zoukankan      html  css  js  c++  java
  • PLIST 读写

       NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);

        NSString *path=[paths objectAtIndex:0];

        NSString *filename=[path stringByAppendingPathComponent:[path stringByAppendingString:@"faceMap_ch.plist"]];

        //NSFileManager *fM=[NSFileManager defaultManager];

            NSMutableDictionary *dic =[[NSDictionarydictionaryWithContentsOfFile:[[NSBundlemainBundle]pathForResource:@"faceMap_ch"ofType:@"plist"]]retain];

        

        

        NSMutableDictionary *ndic = [[NSMutableDictionaryalloc] init];

        NSLog(@"%d",[dic count]);

            for (int i=0; i<[dic count]; i++) {

               

            NSString *key =  [[dic  allKeys] objectAtIndex:i];

                NSString *val = [dic objectForKey:key];

                

                

                [ndic setValue:[key stringByAppendingString:@".png"] forKey:val];

            

            }

            

            

            

            

            

            

            filename=[path stringByAppendingPathComponent:@"tiezi.plist"];

            NSLog(@"%@",filename);

            [ndic writeToFile:filename atomically:YES];

  • 相关阅读:
    yii2权限控制rbac之rule详细讲解
    yii2权限控制rbac之详细操作步骤
    安装 Autoconf, Automake & Libtool
    Linux查看物理CPU个数、核数、逻辑CPU个数
    Nginx端口占用问题
    Druid加密
    Ubuntu16.04安装Zabbix3.2(快速安装教程)
    飞冰ICE
    BeiDou开源项目
    Arthas开源项目
  • 原文地址:https://www.cnblogs.com/StevenFu/p/3087318.html
Copyright © 2011-2022 走看看