• 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
Re: Core Data doesn't save toMany relations please HELP :S
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data doesn't save toMany relations please HELP :S


  • Subject: Re: Core Data doesn't save toMany relations please HELP :S
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 25 Mar 2010 12:33:02 -0700

On Mar 25, 2010, at 11:36, Joanna Carter wrote:

> My rubbish example was to demonstrate that you might want to access the object that is the content of an NSObjectController, as that my be the only way to determine which object is being edited.

So we're hypothesizing that there's some code that calls 'setContent:' on the NSObjectController to switch between different objects*? And some other code that needs to know when the "current" object has been edited? If so ...

I'd prefer to just KVO-observe all the properties that could be changed by editing, and react to the KVO notifications. That way I don't have to know what the editing mechanism is, because I don't care.

Or, I'd prefer to give my File's Owner object a "currentObject" property and bind the object controller to that.

Or, if circumstances preclude either of these approaches, I'd probably invoke the "last resort" clause and ask the object controller for its content.


* It doesn't really change the answer, but that's not how I use object controllers anyway. Instead of switching the content object, I just bind the object controller to the data model (or to, say, a window controller that provide a suitable set of properties based on the data model), and use a "model key" when binding a UI element to the object controller.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Core Data doesn't save toMany relations please HELP :S
      • From: Joanna Carter <email@hidden>
References: 
 >Core Data doesn't save toMany relations please HELP :S (From: Gustavo Pizano <email@hidden>)
 >Re: Core Data doesn't save toMany relations please HELP :S (From: Quincey Morris <email@hidden>)
 >Re: Core Data doesn't save toMany relations please HELP :S (From: Quincey Morris <email@hidden>)
 >Re: Core Data doesn't save toMany relations please HELP :S (From: Joanna Carter <email@hidden>)

  • Prev by Date: Re: Tooltips over buttons ?
  • Next by Date: iPhone movie timestamp
  • Previous by thread: Re: Core Data doesn't save toMany relations please HELP :S
  • Next by thread: Re: Core Data doesn't save toMany relations please HELP :S
  • Index(es):
    • Date
    • Thread