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

Re: NSPersistentDocument arrayController Data


  • Subject: Re: NSPersistentDocument arrayController Data
  • From: Ian McGregor <email@hidden>
  • Date: Fri, 5 Aug 2005 15:05:34 -0700

Hi Harris,

What I am wish to do, is update some of the records in the controlled array, based on an external file each time the document is opened. Lets say the array contains a list of products for a store. When the document is first opened, a field in the products class is checked against more current values in this external file (say product quantity). In reality there will be several fields which will be checked.

At the moment I am having to use a button in the document's window to activate a function to perform this check, once the document has loaded. In a previous version of this application (prior to core data and bindings), this was all done an an ordinary NSMutableArray instance variable of my document class and a function call in windowControllerDidLoadNib.

According to the docs , it seems that I should be able to access the content of the array in windowControllerDidLoad nib, provided I specified "Automatically Prepare Content" for the array controller. This seems not to be the case here.

Thanks,

Ian




On 5-Aug-05, at 1:08 PM, Charilaos Skiadas wrote:

On Aug 5, 2005, at 12:50 PM, Ian McGregor wrote:


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.


Can you be more specific what actions you want to perform on the arrangedObjects? Keep in mind that data is loaded only as needed, so I'm not even sure that arrangedObjects will contain what you expect it to. In sort, if you explain what you are trying to do, maybe we can offer another, simpler, way out.


Maybe you can intercept these objects at another stage?
Also, what makes you think that when the window controller has loaded the nib, the document has already been loaded as well?


Haris






_______________________________________________ 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>
References: 
 >NSPersistentDocument arrayController Data (From: Ian McGregor <email@hidden>)
 >Re: NSPersistentDocument arrayController Data (From: Charilaos Skiadas <email@hidden>)

  • Prev by Date: Re: <relationship fault: 0x4ee6830 ...>
  • Next by Date: How to store a file in Core Data
  • Previous by thread: Re: NSPersistentDocument arrayController Data
  • Next by thread: Re: NSPersistentDocument arrayController Data
  • Index(es):
    • Date
    • Thread