Skip to content

Commit d76bd80

Browse files
committed
CodingTip 的 id 要同时支持 string & number 一下。。
1 parent ad05092 commit d76bd80

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Coding_iOS/Models/CodingTip.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@interface CodingTip : NSObject
1414

1515
@property (readwrite, nonatomic, strong) NSNumber *status;
16-
@property (strong, nonatomic) NSNumber *id, *owner_id, *target_id, *type;
16+
@property (strong, nonatomic) NSNumber *id;
1717
@property (readwrite, nonatomic, strong) NSDate *created_at;
1818
@property (readwrite, nonatomic, strong) NSString *content, *target_type;
1919
@property (readwrite, nonatomic, strong) HtmlMedia *htmlMedia;

Coding_iOS/Models/CodingTip.m

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111

1212
@implementation CodingTip
1313

14+
- (void)setId:(NSNumber *)id{
15+
if ([id isKindOfClass:[NSString class]]){
16+
_id = @([(NSString *)id integerValue]);
17+
}else{
18+
_id = id;
19+
}
20+
}
21+
1422
- (void)setContent:(NSString *)content{
1523
if (_content != content) {
1624
_htmlMedia = [HtmlMedia htmlMediaWithString:content showType:MediaShowTypeImageAndMonkey];

0 commit comments

Comments
 (0)