Skip to content
New issue

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

model中添加pkid属性创建表失败 #60

Open
gracenamucuo opened this issue Sep 20, 2018 · 0 comments
Open

model中添加pkid属性创建表失败 #60

gracenamucuo opened this issue Sep 20, 2018 · 0 comments

Comments

@gracenamucuo
Copy link

当model中含有pkid属性的时候,创建表的时候,生成sqlite语句的时候,因为pkid的时候continue了,生成的sqlite语句是错误的。后边没有括号")"。创建表失败。

  int keyCount = 0;
    for (NSString *key in dic) {
        
        keyCount++;
        if ((nameArr && [nameArr containsObject:key]) || [key isEqualToString:@"pkid"]) {
            continue;
        }
        if (keyCount == dic.count) {
            [fieldStr appendFormat:@" %@ %@)", key, dic[key]];
            break;
        }
        
        [fieldStr appendFormat:@" %@ %@,", key, dic[key]];
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant