NSBundle 读取资源包中的文件

访问项目中资源包里面所有资源使用方法。读取资源包descs.plist文件方法如下:

NSBundle *bundle = [NSBundle mainBundle];                //创建bundle对象

NSString *path = [bundle pathForResource:@“descs” ofType:@“plist”];   //获取资源在机器安装后的系统路径

NSArray *allDescs = [NSArray arrayWithContentsofFile:path];         //根据路径访问plist文件中的数组类
原文地址:https://www.cnblogs.com/litaowei/p/3695335.html