0

I have created a demo (cocoa) in storyboard with coredata selected. I have a tableview and NSArrayController in one of the viewcontroller on storyboard.

Two buttons add and remove are added which are connected to NSArraycontroller. But when I click on add it gives me an exception like Failed to create an object.

Please help. I am new to cocoa development

Soumyaansh
  • 8,626
  • 7
  • 45
  • 45
user3162102
  • 105
  • 1
  • 10
  • click of array controller - > Under bindings -> managedobjectcontext - >manageObjectContext. In the viewcontroller where NSArraycontroller is present i have added a method as return ((AppDelegate*)([NSApplication sharedApplication].delegate)).managedObjectContext; And i have created a button "Add" below the tableview and i have connected that to nsarraycontroller :add method – user3162102 Dec 04 '15 at 11:40
  • Did you set the entity of your arraycontroller? – Willeke Dec 04 '15 at 13:56
  • Yes, I have changed the field from class to entity and given the particular entity name in the field of entity name – user3162102 Dec 07 '15 at 04:04
  • What is the exact text of the exception? – Willeke Dec 07 '15 at 14:52
  • "Failed to create an object". When i created new project with coredata i had added only one entity . Now I added one more entity to the core data its giving exception "Failed to create Object" – user3162102 Dec 08 '15 at 06:08
  • [Failed to Create Object - Simple Core Data App](http://stackoverflow.com/questions/27592954/failed-to-create-object-simple-core-data-app)? – Willeke Dec 08 '15 at 12:06
  • Yes, Working on coredata. When created project single entity was there and when i add new entity it shows "Failed to create an object" – user3162102 Dec 09 '15 at 04:27

0 Answers0