I have an app, backed by Core Data, that I've been working on for awhile. I use version control (formerly SVN, now Git) to m开发者_开发技巧ove it around between different Macs.
The other day, I was unable to open the project. OH CRAP. Luckily, due to Time Machine I was able to go back in time, and reverted to an earlier version. I suspected that something with either the XCode project files or the Core Data files was at play here (I ran into some of the problems that this guy did, I guess), but everything seemed to be working so I moved along.
But now, I realized that when I try to open the .xcdatamodel file in XCode, I can't. It just hangs and then I wind up Force quitting. Aside from that though, the app works totally fine. I can deploy it to the simulator or a device and it works. But I don't know how I have any hope of editing. Any tips on what I can do to fix this?
I was right now in the same situation, but when I've a close look to my model file raw text I saw all elements with strange attributes regarding screen rect
<element name="myEntity" positionX="0" positionY="0" width="0" height="0"/>
so I change this to
<element name="myEntity" positionX="10" positionY="10" width="128" height="240"/>
for all the entities. This did the trick, now I'm able to open to model file again in Xcode.
In the end, I wound up deleting the model file in XCode and rewriting it. Luckily it didn't take very long. If anybody else has a different suggestion on how to fix a corrupted model file please chime in and I can mark your answer as accepted.
精彩评论