LVCChannelsModel.m 997 Bytes
//
//  LVCChannelsModel.m
//  LiveVideoCloud
//
//  Created by iOS on 17/3/27.
//  Copyright © 2017年 cnlive. All rights reserved.
//

#import "LVCChannelsModel.h"

@implementation LVCChannelsModel

- (void)setValue:(id)value forKey:(NSString *)key {
    
    if ([key isEqualToString:@"programs"]) {
        
        NSArray *array = value;
        
        NSMutableArray *arrayM = [NSMutableArray array];
        
        for (NSDictionary *dict in array) {
            
            LVCChannelDetailsModel *model = [[LVCChannelDetailsModel alloc] init];
            
            [model setValuesForKeysWithDictionary:dict];
            
            [arrayM addObject:model];
        }
        
        _programs = arrayM.copy;
        
        return;
    }
    
    [super setValue:value forKey:key];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

- (NSString *)description {
    return [NSString stringWithFormat:@"title:%@, programs:%@",_title,_programs];
}

@end