成都创新互联网站制作重庆分公司

Plist文件读取

+ (NSDictionary *)readFromArchive:(NSString *)aFileName {

网站建设哪家好,找成都创新互联!专注于网页设计、网站建设、微信开发、微信小程序、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了宜君免费建站欢迎大家使用!

    NSString *errorDesc = nil; 

   NSPropertyListFormat format; 

   NSString *plistPath = [[NSBundlemainBundle]pathForResource:aFileName 

                                                          ofType:@"plist"]; 

   NSData *plistXML = [[NSFileManagerdefaultManager] 

                        contentsAtPath:plistPath]; 

   NSDictionary *temp = (NSDictionary *)[NSPropertyListSerialization 

                                          propertyListFromData:plistXML 

                                         mutabilityOption:NSPropertyListMutableContainersAndLeaves 

                                          format:&format errorDescription:&errorDesc]; 

    if (!temp) { 

        NSLog(@"%s at line %d with message: %@", __FUNCTION__, __LINE__, errorDesc); 

    }

    

    return temp;

}


分享文章:Plist文件读取
分享网址:http://cxhlcq.com/article/jghecp.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部