BGFMDB icon indicating copy to clipboard operation
BGFMDB copied to clipboard

崩溃 +(id)getSqlValue:(id)value type:(NSString*)type encode:(BOOL)encode line:664;

Open Beginning-of-a-story opened this issue 6 years ago • 4 comments

因为自定义类没有在 mainBundle 中,但是自定义类不一定在 mainBundle 中,存储一些封装的第三方库包中的类就会这样。望完善(可判断自定义类的bundle是否在mainBundle下)

Beginning-of-a-story avatar Jul 17 '18 07:07 Beginning-of-a-story

那是因为第三方库中没有引入BGFMDB.h这个头文件,在你操作存储的文件中引入BGFMDB.h这个头文件即可.

huangzhibiao avatar Jul 17 '18 08:07 huangzhibiao

NSBundle *bundle = [NSBundle bundleForClass:[value class]]; if(bundle == [NSBundle mainBundle]){//自定义的类 return [self jsonStringWithArray:@[value]]; }else{//特殊类型 return [[NSKeyedArchiver archivedDataWithRootObject:value] base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength]; } 因为是用第三方给的静态库中的模型,不在mainBundle中。这里会被判断为特殊类型

Beginning-of-a-story avatar Jul 24 '18 09:07 Beginning-of-a-story

我页出现同样的问题 BGTool.h 文件的552 行 报错的类型是 [__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 这边是不是应该做一个保护的机制

Moshimol avatar Oct 11 '18 05:10 Moshimol

set 的 时候 value 是0 但是他的类型是NSCFNumber

Moshimol avatar Oct 11 '18 06:10 Moshimol