• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Adding objects to NSArrayController bound to Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding objects to NSArrayController bound to Core Data


  • Subject: Adding objects to NSArrayController bound to Core Data
  • From: Matteo Manferdini <email@hidden>
  • Date: Sun, 14 May 2006 19:09:36 +0200

Hi everyone. I have a custom view which displays objects present in a core data context. My view is bound to an NSArrayController and gets items via arrangedObjects method. Everything works fine.
Now I want to add objects in the core data context when the user double-clicks on the view. How I do that via the controller?
NSArrayController class has a addObject: method, but since the controller is bound to core data the object must be a managed object. But when you create a managedObject it is already created in the context. I can create the object this way and then add it to the controller, but I think this is a wrong way since I skip the controller and go directly into core data. I feel this is wrong also because when you connect a button to the add: method of the controller, it's the controller that creates the new object.
How shoul I do this?
Thank you all.
Cheers.


---
Matteo Manferdini


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Adding objects to NSArrayController bound to Core Data
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: custom NSTextView
  • Next by Date: Re: Adding objects to NSArrayController bound to Core Data
  • Previous by thread: Re: custom NSTextView
  • Next by thread: Re: Adding objects to NSArrayController bound to Core Data
  • Index(es):
    • Date
    • Thread