YH_ChannelModel.m
1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// YH_ChannelModel.m
// YohoLive
//
// Created by 盖剑秋 on 16/6/7.
// Copyright © 2016年 YOHO!. All rights reserved.
//
#import "YH_ChannelModel.h"
@implementation YH_ChannelModel
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
if (self = [super init]) {
_roomTitle = [aDecoder decodeObjectForKey:@"roomTitle"];
_roomURL = [aDecoder decodeObjectForKey:@"roomURL"];
_channel_id = [aDecoder decodeObjectForKey:@"channel_id"];
_cid = [aDecoder decodeObjectForKey:@"cid"];
_app = [aDecoder decodeObjectForKey:@"app"];
_type = [aDecoder decodeObjectForKey:@"type"];
_room = [aDecoder decodeObjectForKey:@"room"];
_totalTime = [aDecoder decodeObjectForKey:@"totalTime"];
if (!_totalTime) {
_totalTime=@"0";
}
_title = [aDecoder decodeObjectForKey:@"title"];
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[aCoder encodeObject:_roomTitle forKey:@"roomTitle"];
[aCoder encodeObject:_roomURL forKey:@"roomURL"];
[aCoder encodeObject:_channel_id forKey:@"channel_id"];
[aCoder encodeObject:_cid forKey:@"cid"];
[aCoder encodeObject:_app forKey:@"app"];
[aCoder encodeObject:_type forKey:@"type"];
[aCoder encodeObject:_room forKey:@"room"];
[aCoder encodeObject:_totalTime forKey:@"totalTime"];
[aCoder encodeObject:_title forKey:@"title"];
}
@end