在代码中读取文件必须用全路径
// 一个NSBundle对象对应一个资源包(图片、音频、视频、plis等文件)
// NSBundle的作用:用来访问与之对应的资源包内部的文件,可以用来获得文件的全路径
// 项目中添加的资源都会被添加到主资源包中
// [NSBundle mainBundle]关联的就是项目的主资源包
NSBundle *bundle = [NSBundle mainBundle];
// 利用mainBundle获得plist文件在主资源包中的全路径
NSString *file = [bundle pathForResource:@"shops" ofType:@"plist"];
// NSString *file = [bundle pathForResource:@"shops.plist" ofType:nil];
// 凡是参数名为File,传递的都是文件的全路径
self.shops = [NSArray arrayWithContentsOfFile:file];