diff --git a/MJExtension/NSObject+MJProperty.m b/MJExtension/NSObject+MJProperty.m index 71b08f4..15c020d 100644 --- a/MJExtension/NSObject+MJProperty.m +++ b/MJExtension/NSObject+MJProperty.m @@ -79,7 +79,10 @@ + (id)mj_propertyKey:(NSString *)propertyName // 查看有没有需要替换的key if ((!key || [key isEqual:propertyName]) && [self respondsToSelector:@selector(mj_replacedKeyFromPropertyName)]) { - key = [self mj_replacedKeyFromPropertyName][propertyName]; + [self mj_enumerateAllClasses:^(__unsafe_unretained Class c, BOOL *stop) { + key = [c mj_replacedKeyFromPropertyName][propertyName]; + if (key) *stop = YES; + }]; } if (!key || [key isEqual:propertyName]) {