Xcode CoreData storage reports an error ., Xcodecoredata

Source: Internet
Author: User

Xcode CoreData storage reports an error ., Xcodecoredata

Due to project interface changes, the previous CoreData field needs to be adjusted. Record the error process and solution. The procedure is as follows:

1. Add the fields to be adjusted in the ***. xcdatamodeld file. And update the local model object.

2. My process is to locally store the message in CoreData after receiving the message, and then display the UI (the specific message push and receipt problems have been completed before. I will not explain them here .). Because it is a real machine debugging, after receiving the message push, there is no data. So I want to go to the local sqlite to check whether the message has been stored, so I caught the path and run it into sqlite. The problem arises:

sqlite3 /var/mobile/Containers/Data/Application/29DC033C-817A-4860-911D-0F110F9B38B4/Documents/JiangSuEchat.sqlite

It is okay to execute the preceding statements. However, you cannot obtain. database; or. tables;

The error is as follows:

sqlite> .tablsError: unknown command or invalid arguments:  "tabls". Enter ".help" for help
sqlite> .databasesError: unable to open database "/var/mobile/Containers/Data/Application/29DC033C-817A-4860-911D-0F110F9B38B4/Documents/JiangSuEchat.sqlite": unable to open database file

Solution:

Error message: the database file cannot be opened.

I am the second. Because CoreData is obviously stored in the mobile phone during debugging on the real machine, isn't it an obvious error that I use a computer to access the path SQLite on the mobile phone? Therefore, after you change the environment to virtual machine debugging, you can obtain the SQLite file path of the Virtual Machine and perform the preceding steps to query the data.

 

3. solve the above problems and proceed. Compile the project. No problem.

When you click message center to read the local SQLite message, an error is returned. As follows:

The model used to open the store is incompatible with the one used to create the store

Solution:

Because CoreData was originally used for persistent storage of data values, after the data fields in it were changed. The conflict exists. Follow these steps to solve the problem:

A. clear project file.

B. Delete the app files in the VM.

Specific solution reference: http://stackoverflow.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.