• 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: Saving NSObjectController info
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving NSObjectController info


  • Subject: Re: Saving NSObjectController info
  • From: mmalcolm crawford <email@hidden>
  • Date: Tue, 15 Feb 2005 15:12:13 -0800


On Feb 15, 2005, at 2:38 PM, James McConnell wrote:

Then how do you advise I go about this simple problem? Because it is the
object controller that is taking care of setting model instance variables
after my textfields have been edited, yet the actual instance of the model
object that the object controller is handling is never specifically
referenced in my code. And the examples I've done (CurrencyConverter with
Bindings to be honest), never actually references the instance of the model
object the object controller handles in the code.
So in MyDocument, how do I archive and unarchive the model object if it is
never explicitly referenced in my code? By having access to the content of
the object controller in the code (MyDocument), I can get to the instance of
the model object.

I'd expect your MyDocument class to have an instance variable for the object that the object controller is managing? Assuming this is the case, the fact that the object is not referenced elsewhere in your code is irrelevant. The object controller"simply" serves as a mediator between the model object it "represents" and the view.
If this is not the case (that is, you don't have an instance variable for the object), I would probably suggest that you add one so that it works as described above. In general it's probably better not to have "free-floating" objects in your nib.


mmalc

_______________________________________________
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


References: 
 >Re: Saving NSObjectController info (From: James McConnell <email@hidden>)

  • Prev by Date: Interface Builder/XCode strangeness with changing the type of buttons on an NSMatrix
  • Next by Date: Re: Child Windows and Mouse Events
  • Previous by thread: Re: Saving NSObjectController info
  • Next by thread: RE: Saving NSObjectController info
  • Index(es):
    • Date
    • Thread