iPhone 64bit Alter Table不起作用

时间:2014-06-12 12:14:11

标签: ios 64-bit 32bit-64bit

当我在32位模拟器上运行我的应用程序时,一切正常,但是当我在64位上运行应用程序时,我收到一条错误消息,而我在数据库中的表是空的。

{
                NSUserDefaults* ud = [NSUserDefaults standardUserDefaults];
                id test = [ud objectForKey:@"upgraded_Info"];
                if (test==nil) {
                    [self execute:@"ALTER TABLE Info ADD COLUMN enableAddressBookBackup INTEGER"];
                    [self execute:@"ALTER TABLE Info ADD COLUMN lastBackup TEXT"];
                    [self execute:@"ALTER TABLE Info ADD COLUMN addressBookBackupInterval INTEGER"];
                    NSArray* statuses = [[self findObjectsOfClass:[Info class]] all];
                    for (Statusobj* so in statuses) {
                        so.enableABookBackup = 0;
                        so.aBookBackupInterval = 10;
                        [self saveObject:];
                    }
                    [ud setObject:@(YES) forKey:@"upgraded_StatusInfo"];
                    [ud synchronize];
                }
            }

在这两种情况下我都收到此警告,但是当我在64上运行时没有结果DB:

"WARNING: preparing (without result) failed for query 'ALTER TABLE Info ADD COLUMN enableAddressBookBackup INTEGER'" 

我需要改变一些特别的东西吗?

0 个答案:

没有答案