IOS学习笔记--懒加载
@property(nonatomic,strong)NSMutableArray *mArray;
-(NSMutableArray *)mArray
{
if (!_mArray) {
_mArray = [NSMutableArray array];
for (NSInteger i = 0; i < 6; i++) {
MyCllectionViewModel *model = [MyCllectionViewModel new];
switch (0) {
case 0:
model.bgImageName = @"pyq_con_pic";
model.title = @"薄雾浓云愁永昼,瑞脑消金…";
model.userName = @"pyq_man01";
model.userImageName = @"不可思议…";
model.likeNuber = @"2252";
break;
default:
break;
}
[_mArray addObject:model];
}
}
return _mArray;
}