We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mj_shouldAutoInheritConfigurations
mj_setup block 设置会自动继承 mj_ 非 block 方法设置不会自动继承
mj_setup
block
mj_
非 block
这里以 mj_replacedKeyFromPropertyName 为例:
mj_replacedKeyFromPropertyName
/// 父类: @interface MJUser : NSObject <MJEConfiguration> ... @end @implementation MJUser + (NSDictionary *)mj_replacedKeyFromPropertyName { return @{ @"speed": @"runSpeed" }; } @end /// 子类: @interface MJFrenchUser : MJUser ... @end @implementation MJFrenchUser + (NSDictionary *)mj_replacedKeyFromPropertyName { return @{ @"nickname": @"surnom" }; } @end
最终 MJUser 的替换列表为
@{ @"speed": @"runSpeed" };
而 MJFrenchUser 的替换列表为
@{ @"nickname": @"surnom" };
提供选择继承与否的方法 mj_shouldAutoInheritConfigurations, 默认为继承, 如果设置为否. 则不保留继承, 与原方案一致 否则保留默认继承的话 MJFrenchUser 的替换列表应为
@{ @"speed": @"runSpeed", @"nickname": @"surnom" };
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
mj_shouldAutoInheritConfigurations
原有方案
mj_setup
block
设置会自动继承mj_
非 block
方法设置不会自动继承逻辑
这里以
mj_replacedKeyFromPropertyName
为例:原有逻辑
最终 MJUser 的替换列表为
而 MJFrenchUser 的替换列表为
改进方案
提供选择继承与否的方法
mj_shouldAutoInheritConfigurations
, 默认为继承, 如果设置为否. 则不保留继承, 与原方案一致否则保留默认继承的话 MJFrenchUser 的替换列表应为
The text was updated successfully, but these errors were encountered: