标签:
@interface ViewController ()
@property (nonatomic, strong) NSArray *shopData;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
_shopData = [NSArray arrayWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"shop" ofType:@"plist"]];
}
@end
- (void)viewDidLoad {
[super viewDidLoad];
}
- (NSArray *)shopData
{
if (!_shopData) {
_shopData = [NSArray arrayWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"shop" ofType:@"plist"]];
}
return _shopData;
}
@end
标签:
原文地址:http://www.cnblogs.com/yuyu-2012/p/4788194.html