NSPersistentDocument arrayController Data
NSPersistentDocument arrayController Data
- Subject: NSPersistentDocument arrayController Data
- From: Ian McGregor <email@hidden>
- Date: Fri, 5 Aug 2005 10:50:49 -0700
When an NSPersistentDocument subclass is loaded, and I attempt to a
access the arrangedObjects in a bound NSArrayController, the array
controller does not appear to contain any data yet. I am attempting
access at the windowControllerDidLoadNib stage.
Which method /delegate/stage should I use to be sure the
NSArrayController is ready to give me access to the stored data
(arrangedObjects)? I'd like to perform actions on the array
controller's arrangedObjects each time a document is loaded.
In the NSPersistentDocument subclass:
- (void)windowControllerDidLoadNib:(NSWindowController *)
windowController
{
[super windowControllerDidLoadNib:windowController];
unsigned int count = [[myArrayController arrangedObjects]
count]; // 0
}
- (void)someMethod
{
unsigned int count = [[myArrayController arrangedObjects]
count]; // value i.e. 243
}
Cheers,
Ian
_______________________________________________
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