Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d76bd80

Browse files
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /