TableView Crashing/Freezing Because Of Core Data Error

后端 未结 2 699
难免孤独
难免孤独 2021-01-28 18:01

When the user clicks the + button in the navbar, a UIAlert with text prompt comes up. The user then enters a string into the prompt and it should result in a new UITableViewCel

2条回答
  •  抹茶落季
    2021-01-28 18:56

    The "NSInternalInconsistencyException" error is related to having changed your underlying data model to the extent that Core Data can't perform an automatic lightweight data migration: the actual SQLite or plist file you're using to store your data is now incompatible with the new structure of the data model.

    To clear it up you can either just delete the app from the simulator (or device, if that's where you're testing) the usual way -- pressing and holding the app icon until it wiggles and then tapping/clicking the X -- or by deleting the file itself from the app's working directory on your Mac.

    ~/Library/Application Support/iPhone Simulator/YOUR-IOS-BASE-SDK-HERE/Applications/YOUR-36-BYTE-APP-ID-HERE/Documents

    (Or if not Documents, whichever folder you used.)

    After that you can run the app that this particular error will disappear because Core Data will be able to create the file from scratch again.

提交回复
热议问题