Skip to content

Commit

Permalink
Merge pull request #630 from banchichen/master
Browse files Browse the repository at this point in the history
新增mj_keyValuesDidFinishConvertingToObject:方法,在字典转模型结束时把keyValues传给业务方
  • Loading branch information
CoderMJLee authored Aug 16, 2018
2 parents e545653 + 23c5978 commit 62e7fde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions MJExtension/NSObject+MJKeyValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
* 当字典转模型完毕时调用
*/
- (void)mj_keyValuesDidFinishConvertingToObject;
- (void)mj_keyValuesDidFinishConvertingToObject:(NSDictionary *)keyValues;

/**
* 当模型转字典完毕时调用
Expand Down
5 changes: 4 additions & 1 deletion MJExtension/NSObject+MJKeyValue.m
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ - (instancetype)mj_setKeyValues:(id)keyValues context:(NSManagedObjectContext *)
if ([self respondsToSelector:@selector(mj_keyValuesDidFinishConvertingToObject)]) {
[self mj_keyValuesDidFinishConvertingToObject];
}
if ([self respondsToSelector:@selector(mj_keyValuesDidFinishConvertingToObject:)]) {
[self mj_keyValuesDidFinishConvertingToObject:keyValues];
}
return self;
}

Expand Down Expand Up @@ -706,4 +709,4 @@ - (NSString *)JSONString
{
return [self mj_JSONString];
}
@end
@end

0 comments on commit 62e7fde

Please sign in to comment.