+(instancetype)appWithDict:(NSDictionary *)dict
{
HMApp *app = [[self alloc] init];
[app setValuesForKeysWithDictionary:dict];
return app;
}
-(NSMutableArray *)apps
{
if (!_apps) {
NSString *file = [[NSBundle mainBundle] pathForResource:@"apps" ofType:@"plist"];
NSArray *dictArray = [NSArray arrayWithContentsOfFile:file];
NSMutableArray *appArray = [NSMutableArray array];
for (NSDictionary *dict in dictArray) {
HMApp *app = [HMApp appWithDict:dict];
[appArray addObject:app];
}
self.apps = appArray;
}
return _apps;
}