利用NSBundle可以访问某个资源包里的内容,如果要访问项目中最主要资源包里面的内容,应该使用mainBundle:
NSBundle *bundle = [NSBundle mainBundle];
可以通过解析plist文件来创建数组对象,如获取文件的全路径:
NSString *path = [bundle pathForResource:@"descrps" ofType:@"plist"];
_Arr = [NSArray arrayWithContentsOfFile:path];
有关plist文件的使用:
加载一个plist文件的时候,会返回一个plist的根节点对象(Root);