plist
@interface ViewController ()
@property (nonatomic, strong) NSArray *heroes;
@implementation ViewController
- (NSArray *)heroes
{
if (!_heroes) {
NSString *path = [[NSBundle mainBundle] pathForResource:@"heroes.plist" ofType:nil];
NSArray *dictArray = [NSArray arrayWithContentsOfFile:path];
NSMutableArray *heroArray = [NSMutableArray array];
for (NSDictionary *dict in dictArray) {
RYJHeroes *hero = [RYJHeroes heroWithDict:dict];
[heroArray addObject:hero];
}
_heroes = heroArray;
}
return _heroes;
}