NSBundle 读取资源包中的文件

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

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

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

NSArray *allDescs = [NSArray arrayWithContentsofFile:path];         //根据路径访问plist文件中的数组类

 

posted on 2014-04-27 22:24  馅饼在哪颗星  阅读(355)  评论(0编辑  收藏  举报

导航