YYModel icon indicating copy to clipboard operation
YYModel copied to clipboard

High performance model framework for iOS/OSX.

Results 105 YYModel issues
Sort by recently updated
recently updated
newest added

最近要新写一个 App,正在研究模型化方案选型。我比较了 JSONModel 和 YYModel,收获很大。我发现 JSONModel 中封装的 KeyMapper,是一个非常重要的设计概念。它将 Mapper 逻辑从模型中剥离,能够自由的组合。 想象一下这样的场景,你有两套不同的 API,上传同一个对象,他们的协议不同,A 协议要求 book_id 而 B 协议要求 bookID,这种情况当前的 YYModel 设计只能在 NSDictionary => Model 环节兼容这种情况,而反向则不行。 期待你的留言。

我在一个案例中读取一个繁体的名字 + (nullable NSDictionary *)modelCustomPropertyMapper{ return @{@"name":@"name_tc"}; } APP中更换语言后,需要读取简体的名字,所以我就动态把name_tc改成name_sc + (nullable NSDictionary *)modelCustomPropertyMapper{ return @{@"name":@"name_sc"}; } 可是我发现YYModel会缓存同一个类上一次的mapper,导致我无法按照新的mapper去读取值

This is my model class: ``` @interface YYWebArticle : YYArticle @property (nonatomic, strong) NSString *url; @property (nonatomic) CGRect rect; @property (nonatomic) NSValue *myRect; @end ``` ``` @implementation YYWebArticle + (nullable...

If not fixed, YYModel will not pass the Test below: ``` @interface YYNSValueTestObject : NSObject @property (nonatomic, strong) NSValue *point; @property (nonatomic, strong) NSValue *vector; @property (nonatomic, strong) NSValue *size;...

这个情况其实比较小众,但是如果服务端的数据为了适配多端并且没有商量好的话,有时候原本应该给字符串的地方可能会给成整型或者其他什么类型,这种情况线上出了问题,哪个端都不好改

你好,想咨询下YYmodel是否扩展下对自定义数据类型比如RLMArray的兼容呢。^_^

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key timeStamp.' 方法调用栈: -[YYClassMethodInfo initWithMethod:] -[YYClassInfo _update] -[YYClassInfo initWithClass:] +[YYClassInfo...

正常的解析一段json的数组,报这个错,以前一直这么用 我的返回数据以及调用是这样的 NSArray * datalist = [NSArray yy_modelArrayWithClass:[NewSearchResult class] json:result[@"list"]]; json { list = ( { IsPackage = 0; PlatNum = 1; objectId = 190944; objectName = "\U5c0f\U59d0\Uff1a\U4f60\U597d\Uff01\U6211\U60f3\U91c7\U8bbf\U4f60\U4e00\U4e0b\U2026\U2026"; objectType =...

提供包含字典数组的转换方法: + (NSMutableArray *)yy_modelArrayWithKeyValueArray:(NSArray *)keyValueArray; 递归调用+ (instancetype)yy_modelWithDictionary:(NSDictionary *)dictionary方法不改变原有嵌套结构,如果元素不是字典则返回一个没有默认值的模型实例。