Cannot Create NSSet from object


#1

When in the departments view and I select on of the departments, the app throws the following:

Cannot create NSSet from object <Employee: 0x6080000a6240> (entity: Employee; id: 0x6080002284a0 x-coredata:///Employee/t5D8211EC-CD3F-4432-BEA5-5B37CC5A59D16 ; data: {
department = “0x60800022a940 x-coredata://033B26E9-8551-46AE-8492-F1423E43FB60/Department/p2”;
firstName = Mark;
lastName = Lantry;
}) of class Employee

IN the employees view, Mark does have a valid department name. Also, the Box title does not change to the selected department, the Manager pop-up menu does not list anything, and the employees within the departed are not listed.

I have trippled checked all my bindings. Using Xcode 5.1.1

Thanks in advance for any insight…

Ray


#2

I second this error when selecting a Department name that has an employee assigned to it.

In employees the popup deptName cannot be assigned to multiple users.
I verified the entities and Inverse is selected.
I noticed that there is a difference in the entities diagram created with Xcode 6 ( my diagram has only one arrow to department ) while the supplied example has 2 arrows ( to many )
I redid from scratch the chap 32 6 times and getting the same bug every time.

I am sure there is a bug with entity creation using Xcode.

I’ll be trying NSMAnagedObjectModel instead if the buggy Xcode Data Modeller.


#3

The bug really comes from Xcode’s Entity Data Modelling! I used BNR’s Xcode example, deleted the xcdatamodeld, created a new one. recreated the entities and relations .Now BNR version does not work.

Thank you Apple… sigh!

I don’t know if it’s my installation? I’ll have to try on an other mac.


#4

Frack Me Big Time … Three times!
I just noticed the right column where you need to select the ( insert curse word here ) “To Many” option.

Solution, make sure the Department/employees relation is set to Type: To Many. Located in the utilities column on the right.

This is a real case of error 36 :slight_smile:

Case closed!