- (NSArray *)groups

{

    if (_groups == nil) {

       // NSArray *dictArray = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"friends.plist" ofType:nil]];

        NSString *path = [[NSBundle mainBundle]pathForResource:@"friends.plist" ofType:nil];

        NSArray *dictArray = [[NSArray alloc]initWithContentsOfFile:path];

        

        NSMutableArray *groupArray = [NSMutableArray array];

        for (NSDictionary *dict in dictArray) {

            CHFriendGroup *group = [CHFriendGroup groupWithDict:dict];

            [groupArray addObject:group];

        }

        

        _groups = groupArray;

    }

    return _groups;

}

//懒加载

posted on 2015-05-30 23:52  完美基因  阅读(118)  评论(0)    收藏  举报