I made a lightweight migration that I decided I don’t want anymore. Is there any way to just delete the file? I’ve already changed the current model version to the one before it, and the app runs. However, when I right-click on the .xcdatamodel file in the Xcode file viewer, “Delete” is greyed-out. I also tried to remove the file from Finder, but it keeps the file in Xcode, redded-out.
Is there any way to fix this?
Yes – having done this a lot, to my knowledge the only way is to open up YourProject.xcodeproj/project.pbxproj in your favourite raw text editor (vim ftw!), and search for and remove both instances of the offending model file. Ie:
So in this case, I go hunting for the two instances of
D6199DD5143DE428002869C1and delete them both from the project file, and bang: Bob’s my uncle. Also – you can reorder that chunk of children above in case you want the current one higher.After I do that, I typically execute a manual source repo delete command on just the model-V8 dir too.