Re: Knowing when a NSArrayController is ready
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