scubers / JRDB

MIT License
506 stars 91 forks source link

升级到xcode12后报许多错误 #62

Closed zqgogo closed 3 years ago

zqgogo commented 4 years ago

如题,升级到xcode12后突然报了很多错误,排查了之后大多都是类型问题,比如JRMiddleTable.m文件的111行报错信息为Incompatible block pointer types sending 'void (^)(FMDatabase _Nonnull __strong, BOOL _Nonnull)' to parameter of type 'void (^ _Nonnull)(id _Nonnull __strong, BOOL * _Nonnull)',查看后发现FMDatabase是有扩展的,也引入头文件了,不明白为何还会报错。其他的错误也是类似的这样的问题。大佬有时间升级看下吗?

SmallwolfiOS commented 3 years ago

pod "JRDB", :git => 'https://github.com/scubers/JRDB.git', :branch => 'fix/xcode12_compile' may fix your issue

xue03106991 commented 3 years ago

或者在Build Settings - Custom Complier Flags- C和C++ 上 加上 -Xclang -fcompatibility-qualified-id-block-type-checking

SFFinder commented 3 years ago
[_db jr_inTransaction:^(id<JRPersistentBaseHandler>  _Nonnull handler, BOOL * _Nonnull rollBack) {
    NSString *sql =
    [NSString stringWithFormat:@"delete from %@ where (%@ not in (select %@ from %@)) or (%@ not in (select %@ from %@))"
     , [self tableName]
     , MiddleColumn4Clazz(_clazz1)
     , DBIDKey
     , [_clazz1 jr_tableName]
     , MiddleColumn4Clazz(_clazz2)
     , DBIDKey
     , [_clazz2 jr_tableName]];
    *rollBack = ![handler jr_executeUpdate:sql params:nil];
}];

我看db对象是JRPersistentBaseHandler

wenlla commented 2 years ago

请问楼主是怎么解决的呢? 我遇到了同样的问题....