Frustrated beyond frustration


I’m getting the following error and am trying to track down the source but wanted to see if I could get any help.

CoreData: error: Property ‘setDateCreated:’ is a scalar type on class ‘BNRItem’ that does not match its Entity’s property’s scalar type. Dynamically generated accessors do not support implicit type coercion. Cannot generate a setter method for it.

So I have rebuilt the app three times for Chapter 16 and am now unable to get a working application. Since I did not receive a reply to my previous question above and did not know where to go, I decided to just redo Chapter 16. Not knowing the ramifications of having the same project run on the simulator I removed the folder from the simulator files. I am now, after what I thought was meticulously following the instruction in Chapter 16, getting the following error and the app will not even run: Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Can’t merge models with two different entities named ‘BNRItem’’.

I have looked through the code and do not see multiple instances of BNRItem defined anywhere. Is this left over from previous trials?

This chapter has left me with a bitter taste in my mouth for not only CoreData but iOS programming in general. My frustration lies also with the errors generated and no clear understanding of what is happening. This is just unbelievably frustrating because I don’t even know where to start looking for a solution.


I decided to search the Documentation for the error I was getting and hoping there would be something useful. Fortunately, there was - the exact error I was getting. It suggested I run Clean. I did this a couple of times to no avail. It also said I could delete the application. So, I removed all simulator files from within Finder, opened my project, ran Clean, and it worked. I guess Core Data was having issues with former data files named BNRItem even though they were in a separate application and were removed - at least I thought so.

WHile reading I came across some troubling info about Core Data. Basically, the way I read it was if you make any changes to your model files, attributes etc. you will be hosed and will have to go through migration etc. Is this true? Is a complicated process? I thought CD was an “easy” data structure to utilize, but I’m feeling like it is very picky and snarky.


CoreData is not a data structure. CoreData is a framework for creating an environment for making objects persistent and resurrecting them.

It is not an easy topic to fully grasp in few days; however, Apple provides good learning resources.


Thanks, ibex. Just a moment of frustration. I’ve read your posts regarding core data etc. I agree for the most part that we, as iOS students, should embrace and study Apple docs. I just wish a subject such as CD would have been more thoroughly covered. I know they, BNR, can’t cover everything, but they could provide more insight.

At any rate, the book is excellent and am really liking the challenges at the end.