MJExtension屬性名稱變換(系統的關鍵字:id)


一些系統關鍵字的變換(服務器傳的key名稱id   轉   模型中的tid),記錄下:(本來是放在有道雲筆記里面,整理筆記時,拿出來。。。其實沒必要放博客的 = =)

 1 #import <Foundation/Foundation.h>
 2 
 3 @interface RecentModel : NSObject
 4 
 5 @property (nonatomic, assign) NSUInteger authorid;
 6 
 7 @property (nonatomic, retain) NSString *content;
 8 
 9 @property (nonatomic, assign) NSUInteger tid;
10 
11 @end

------------------------------------------

 1 #import "RecentModel.h"
 2 
 3 @implementation RecentModel
 4 
 5 + (NSDictionary *)replacedKeyFromPropertyName {
 6 
 7     return @{
 8 
 9              @"tid":@"id"
10 
11              };
12 
13 }
14 
15 @end

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM