• 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: Knowing when a NSArrayController is ready
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Knowing when a NSArrayController is ready


  • Subject: Re: Knowing when a NSArrayController is ready
  • From: "email@hidden" <email@hidden>
  • Date: Sat, 24 Jan 2009 09:07:59 +0000


On 24 Jan 2009, at 02:43, David LeBer wrote:

This may be a stupid question, but I've had reason to wonder a number of times.

If I have an NSArrayController in a nib, bound to a MOC, configured with an Entity name and set to prepare content:

Is there a way to be notified when it has finished loading and arranging it's objects?

Hi David

Adding an observer on the controller's arrangedObjects property should do the trick.

[arrayController addObserver:self forKeyPath:@"arrangedObjects" options:0 context:(void *)&ControllerContentContext];

In a persistent document based app, for example, the controller's MO content is not yet available in - (void)windowControllerDidLoadNib: (NSWindowController *)windowController.
Adding the observer means you can set up any dependent code when the binding/core data machinery has finished doing its thing.



;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: 	http://codeferous.com
blog: 	http://davidleber.net
profile:	http://www.linkedin.com/in/davidleber
twitter:	http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________

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

Jonathan Mitchell

Central Conscious Unit
http://www.mugginsoft.com




_______________________________________________

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


References: 
 >Knowing when a NSArrayController is ready (From: David LeBer <email@hidden>)

  • Prev by Date: Re: NSNumberFormatter setFormat: in 10.3.9
  • Next by Date: Re: Poof! Recently-saved Core Data document suddenly gets dirty
  • Previous by thread: Knowing when a NSArrayController is ready
  • Next by thread: Re: Knowing when a NSArrayController is ready
  • Index(es):
    • Date
    • Thread