|
@@ -404,6 +404,7 @@ static force_inline id YYValueForMultiKeys(__unsafe_unretained NSDictionary *dic
|
|
/// A class info in object model.
|
|
/// A class info in object model.
|
|
@interface _YYModelMeta : NSObject {
|
|
@interface _YYModelMeta : NSObject {
|
|
@package
|
|
@package
|
|
|
|
+ YYClassInfo *_classInfo;
|
|
/// Key:mapped key and key path, Value:_YYModelPropertyInfo.
|
|
/// Key:mapped key and key path, Value:_YYModelPropertyInfo.
|
|
NSDictionary *_mapper;
|
|
NSDictionary *_mapper;
|
|
/// Array<_YYModelPropertyMeta>, all property meta of this model.
|
|
/// Array<_YYModelPropertyMeta>, all property meta of this model.
|
|
@@ -554,6 +555,7 @@ static force_inline id YYValueForMultiKeys(__unsafe_unretained NSDictionary *dic
|
|
if (keyPathPropertyMetas) _keyPathPropertyMetas = keyPathPropertyMetas;
|
|
if (keyPathPropertyMetas) _keyPathPropertyMetas = keyPathPropertyMetas;
|
|
if (multiKeysPropertyMetas) _multiKeysPropertyMetas = multiKeysPropertyMetas;
|
|
if (multiKeysPropertyMetas) _multiKeysPropertyMetas = multiKeysPropertyMetas;
|
|
|
|
|
|
|
|
+ _classInfo = classInfo;
|
|
_keyMappedCount = _allPropertyMetas.count;
|
|
_keyMappedCount = _allPropertyMetas.count;
|
|
_nsType = YYClassGetNSType(cls);
|
|
_nsType = YYClassGetNSType(cls);
|
|
_hasCustomTransformFromDictionary = ([cls instancesRespondToSelector:@selector(modelCustomTransformFromDictionary:)]);
|
|
_hasCustomTransformFromDictionary = ([cls instancesRespondToSelector:@selector(modelCustomTransformFromDictionary:)]);
|
|
@@ -576,7 +578,7 @@ static force_inline id YYValueForMultiKeys(__unsafe_unretained NSDictionary *dic
|
|
dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER);
|
|
dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER);
|
|
_YYModelMeta *meta = CFDictionaryGetValue(cache, (__bridge const void *)(cls));
|
|
_YYModelMeta *meta = CFDictionaryGetValue(cache, (__bridge const void *)(cls));
|
|
dispatch_semaphore_signal(lock);
|
|
dispatch_semaphore_signal(lock);
|
|
- if (!meta) {
|
|
|
|
|
|
+ if (!meta || meta->_classInfo.needUpdate) {
|
|
meta = [[_YYModelMeta alloc] initWithClass:cls];
|
|
meta = [[_YYModelMeta alloc] initWithClass:cls];
|
|
if (meta) {
|
|
if (meta) {
|
|
dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER);
|
|
dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER);
|