1

I get this warning for my xdatamodeld file: "Version hash information not available for all models". How do I get rid of this? I've also started to get a crash at startup when I install the app as new ... wonder if they're related? This is the crash:

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Cannot create an NSPersistentStoreCoordinator with a nil model'

Z S
  • 7,039
  • 12
  • 53
  • 105

4 Answers4

3

This is a iOS5 beta issue, caused by having a fetch request in your model file. For now, removing the fetch request fixes it.

Z S
  • 7,039
  • 12
  • 53
  • 105
0

I am experiencing the same thing once I have installed Xcode 4.2 with iOS 5 beta 5, maybe it's something there? I did not have is last night while working on my production system, with Xcode 4.1. Unfortunately I am reinstalling it now, and it'd take a while before i know whether that's the cause.

  • As I found out, it's definitely because of the beta, and it happens if you have a fetch request in your model file. Remove it if you can and it'll work fine. – Z S Aug 11 '11 at 06:48
  • Thanks, I resolved by removing the beta, and installing production version of Xcode - i don't have time to experiment, we're running low on time. However I do have fetch requests in the model, so that explains it then. Great that you have found that out! – Robert Geifman Aug 11 '11 at 10:55
  • Please post such messages as comments, not as answers. – rluba Aug 16 '11 at 12:06
0

The first error indicates that you have multiple .xcdatamodel files with the same name but different versions. One of more of the multiples lacks an internal version number i.e. the version hash.

The second error is caused by the first because the managed object model cannot create itself by merging model files of the same name but different and unknown versions. A persistent store coordinator in turn cannot intialize without a valid managed object model.

If this is occurring in development and you don't have multiple versions intentionally, then you probably have an old compiled .mom or .momd file on the simulator from a previous build. Delete the app off the simulator entirely, then clean the entire project in Xcode and rebuild and reinstall. That usually resolves the problem.

TechZen
  • 64,370
  • 15
  • 118
  • 145
  • Thanks, but turned out that the root cause was because of the beta, where having a fetch request in my model file caused this warning and the crash. Removing the fetch request fixed it. – Z S Aug 11 '11 at 06:49
  • @ZS -- you should create an answer with the fix so others can find it. You can accept your own answers after 24hrs. – TechZen Aug 11 '11 at 14:13
0

I ran into this problem on iOS 5 SDK and it wasn't any of the above problems. My problem was because I had a lot of attributes in a single entity, that I inadvertently had a duplicate (i.e. two lastUpdatedDate attributes in the same entity).

Joseph DeCarlo
  • 3,268
  • 23
  • 28