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
删除app后重新安装,会一直提示以下问题,请问怎么解决,谢谢! 注意:你操作的模型SYPersonModel在数据库中没有对应的数据表,框架正在全自动创表,并稍后自动重新执行您的操作,请放心!
The text was updated successfully, but these errors were encountered:
问题已解决,出现这个问题的原因是,我临时更改数据库路径,然后,在调用时没有对CoreModel的所有子类建表,解决的办法就是对CoreModel重新建表 #include <objc/runtime.h>
(NSArray *)findAllOf:(Class)defaultClass{
int count = objc_getClassList(NULL, 0); if (count <= 0){
@throw@"Couldn't retrieve Obj-C class-list"; return [NSArray arrayWithObject:defaultClass];
}
NSMutableArray *output = [NSMutableArray arrayWithObject:defaultClass];
Class *classes = (Class *) malloc(sizeof(Class) * count);
objc_getClassList(classes, count);
for (int i = 0; i < count; ++i) { if (defaultClass == class_getSuperclass(classes[i])){//子类
[output addObjectsFromArray:[CoreModel findAllOf:classes[i]]]; }
free(classes);
return [NSArray arrayWithArray:output]; }
下面是重新建表 NSArray *array = [CoreModel findAllOf:[CoreModel class]]; for (id classStr in array) { [classStr initialize]; }
Sorry, something went wrong.
No branches or pull requests
删除app后重新安装,会一直提示以下问题,请问怎么解决,谢谢!
注意:你操作的模型SYPersonModel在数据库中没有对应的数据表,框架正在全自动创表,并稍后自动重新执行您的操作,请放心!
The text was updated successfully, but these errors were encountered: