profile
viewpoint

Ask questionsJSON转模型 提供模型更新接口

能否提供一个更新模型的update的接口?

CoderMJLee/MJExtension

Answer questions songhongkang

阅读源码发现MJ做了更新功能 // 1.Define a JSONString NSString *jsonString = @"{"name":"Jack", "icon":"lufy.png", "age":20}"; // 2.JSONString -> User User *user = [User mj_objectWithKeyValues:jsonString]; // 3.jsonString中的age变成21 NSString *jsonString1 = @"{"age":21}"; // 4.更新模型 [user mj_setKeyValues:jsonString1];

useful!
source:https://uonfu.com/
Github User Rank List