1.NSBundle
1> 一个NSBundle代表一个文件夹,利用NSBundle能访问对应的文件夹
2> 利用mainBundle就可以访问软件资源包中的任何资源
3> 模拟器应用程序的安装路径
/Users/用户名/资源库/Application Support/iPhone Simulator/7.1/Applications
怎样将文件加载到程序代码?
例如将imageData.plist加载到程序代码中使用
示例如下:
//利用mainBundle就可以访问软件资源包中的任何资源
NSBundle *bundle = [NSBundle mainBundle];
// 获得imageData.plist的全路径
NSString *path = [bundle pathForResource:@"imageData"ofType:@"plist"];
或者用下面方法:
// NSString *path = [bundle pathForResource:@"imageData.plist" ofType:nil];
// 用数组接收plist数据
_imageData = [NSArray arrayWithContentsOfFile:path];