• 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
NSPersistentDocument arrayController Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSPersistentDocument arrayController Data
      • From: Charilaos Skiadas <email@hidden>
  • Prev by Date: Deleting the last word of an NSString
  • Next by Date: Intelligent date squishing
  • Previous by thread: Re: Deleting the last word of an NSString
  • Next by thread: Re: NSPersistentDocument arrayController Data
  • Index(es):
    • Date
    • Thread