• 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];

  • 相关阅读:
    C字符串格式化
    oms登录bug
    宏旺文章审核功能使用指引
    phpcms文章审核
    html5的pushState 无刷新, 前进后退等
    js路由—backbone的路由的实现02
    js路由—backbone的路由的实现01
    js路由—简单路由的实现
    img标签和css的background-image的区别
    querySelector与querySelectorAll
  • 原文地址:https://www.cnblogs.com/StevenFu/p/3087318.html
Copyright © 2020-2023  润新知