problem with import of sqlite database
I have a prepolutated sqlite database, which I include as a resource in my app, because it would take too long to fill the database at startup. I created the prepopulated database with core data, so everything should be fine. On a iphone 4 with iOS 4.2.1 this is the case, however when I t开发者_如何学Pythonest the exact same code on an iPhone 3GS, also running iOS 4.2.1, the database is copied to the documents folder, but there is never a result when I fetch for something in the database. Is the database layout on an iPhone 3GS different from the layout on an iPhone 4 (even if they have the same iOS version running) ? Can someone explain me the reason for this behaviour?
Solved it by changing
[[NSFileManager defaultManager] moveItemAtPath:srcPath toPath:dstPath error:&error];
into
[[NSFileManager defaultManager] copyItemAtPath:srcPath toPath:dstPath error:&error];
Seems strange to me but it works now...
精彩评论