Re: Frustrating...
Re: Frustrating...
- Subject: Re: Frustrating...
- From: Quentin Mathé <email@hidden>
- Date: Tue, 14 Jan 2003 03:37:07 +0100
Le mardi, 14 jan 2003, ` 02:49 Europe/Paris, Jeff LaMarche a icrit :
I've hit a bit of a frustrating problem. I've got a document-based app
I'm working on. I've implemented loadDataRepresentation: ofType: to
handle opening files. I have a method called updateUI that I use to
populate text fields from the document's data, which I call after
unarchiving the data:
- (BOOL)loadDataRepresentation:(NSData *)uData ofType:(NSString *)aType
{
[self setData:[NSUnarchiver unarchiveObjectWithData:uData]];
[self updateUI];
return data != nil;
}
Here's the first part of updateUI (with some calls to NSLog) to
illustrate the problem I'm having:
- (void)updateUI
{
NSLog(@"Updating User Interface");
NSLog(@"Value for Line1: %@", [[data clientAddress] line1]);
[billingAddress1TF setStringValue:[[data clientAddress] line1]];
NSLog(@"Line 1 Set to: %@", [billingAddress1TF stringValue]);
....
When you open a document :
1. The data is loaded by your NSDocument subclass
2. The nib file associated with this document is loaded by the window
controller
3. You fill the document with the loaded data
To know when the nib file is loaded, it's very simple because the
NSWindowController call the method windowControllerDidLoadWindowNib:,
then you just need to override this method like that :
- (void)windowControllerDidLoadWindowNib:(NSWindowController
*)windowController {
[super windowControllerDidLoadWindowNib:windowController];
// fill my document here
}
--
Quentin Mathi
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.