sqlite ios : attempt to write a readonly database

前端 未结 5 1629
天涯浪人
天涯浪人 2021-01-15 05:52

I use a sqlite database for a project. I can do queries like SELECT but impossible to do INSERTs! On the simulator the INSERT works properly. As soon as I compile on my iPod

5条回答
  •  猫巷女王i
    2021-01-15 06:23

    In case anyone else sees this...I started getting this error on one of my devices (iPhone 4s/iOS7) after upgrading to Xcode 5.2. It didn't happen on my iPhone 5 (iOS 6). It occurred when getting metadata from the store:

    NSDictionary *storeMetadata = [NSPersistentStoreCoordinator metadataForPersistentStoreOfType:NSSQLiteStoreType URL:storeURL error:&error];
    

    Deleting my app and reinstalling it fixed the problem.

提交回复
热议问题