Skip to content

Commit

Permalink
Merge pull request #69 from CarryCN/master
Browse files Browse the repository at this point in the history
解决:一个类存在多个表(多用户)的情况下,添加字段,多个表无法实现字段更改.此修改将表字段的比较跟表名字关联,而不是类名关联.
  • Loading branch information
huangzhibiao authored Jul 4, 2018
2 parents b33027d + 2b545bf commit 179dda2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion BGFMDB/libs/BG/BGDB.m
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,9 @@ -(void)refreshTable:(NSString* _Nonnull)name class:(__unsafe_unretained _Nonnull
-(void)ifIvarChangeForObject:(id)object ignoredKeys:(NSArray*)ignoredkeys{
//获取缓存的属性信息
NSCache* cache = [NSCache bg_cache];
NSString* cacheKey = [NSString stringWithFormat:@"%@_IvarChangeState",[object class]];
NSString *tableName = [object valueForKey:bg_tableNameKey];
tableName = tableName.length ? tableName : NSStringFromClass([object class]);
NSString* cacheKey = [NSString stringWithFormat:@"%@_IvarChangeState",tableName];
id IvarChangeState = [cache objectForKey:cacheKey];
if(IvarChangeState){
return;
Expand Down

0 comments on commit 179dda2

Please sign in to comment.