• 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
NSViewController and key value coding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSViewController and key value coding


  • Subject: NSViewController and key value coding
  • From: Andrew James <email@hidden>
  • Date: Mon, 12 Jul 2010 16:40:09 -0700 (PDT)

All,

I've been writing way to much code to populate an NSPopUpButton with an array
that can change at any moment.  Due to that, I'd rather use Cocoa's Key Value
Coding technology.  I've read Apple docs over the past two days in regards to
key value coding and observing.

To really cement my understanding, I'd like to have an intial implementation
that uses a programatically configured NSViewController.  By that I mean
explicitly setting the view ( -setView ) and the represented object (
-setRepresentedObject ) of the NSViewController instance.

The view will be an NSPopUpButton and the  represented object will be an
instance of  key value coding compliant class that conforms to the Indexed
Accessor requirements.

If the NSViewControllers view and represented object are correctly set...

1) Will the controller auto-magically insure that the pop up button gets
populated with data pulled from the represented object?
2) Does the controller register as a key value observer with the represented
object?
3) If changes to the represented object can come in from threads other than the
main thread will the NSViewController key value observing implementation handle
delivering requests to redraw to the main thread? Or does the represented object
have to make sure that all of it's changes occur on the main thread?

Cheers,
--aj



_______________________________________________

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: NSViewController and key value coding
      • From: Mike Abdullah <email@hidden>
  • Prev by Date: Re: newbie core data question
  • Next by Date: NSResizableWindowMask and view update
  • Previous by thread: Missing Source managed object model
  • Next by thread: Re: NSViewController and key value coding
  • Index(es):
    • Date
    • Thread