Re: Frustrating...
Re: Frustrating...
- Subject: Re: Frustrating...
- From: Mike Ferris <email@hidden>
- Date: Tue, 14 Jan 2003 08:06:02 -0800
Be sure to call updateUI from loadDataRepresentation...: as well. When
a user reverts, the nib will already have been loaded.
It is often useful to have a method like updateUI that simply checks to
see if there is UI and then fills it if there is. Then you should call
this method from the load method (or possibly whenever your document
changes) and also when the UI is first loaded.
Ideally, what you want is a somewhat loose coupling so that whenever
data changes in your document, the UI(s) get updated. That way you'll
be all set if you ever need to show the same data in multiple places
since the user can change it from one place, it will get set in the
document and then any other places it is displayed will automatically
get updated.
Mike
Begin forwarded message:
From: Jeff LaMarche <email@hidden>
Date: Mon Jan 13, 2003 7:18:42 PM US/Pacific
To: Quentin Mathi <email@hidden>,
email@hidden
Subject: Re: Frustrating...
On Monday, January 13, 2003, at 09:37 PM, Quentin Mathi wrote:
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
}
I'm not finding any reference to windowControllerDidLoadWindowNib, I'm
guessing you mean windowControllerDidLoadNib. I had already tried
putting my call to updateUI in windowControllerDidLoadNib, which
didn't work. However, I tried again and it is now working. I think the
reason it didn't work before was due to an unrelated bug I had in my
encodeWithCoder: method and have since fixed, because everything seems
to be dandy now.
Thanks for the help!
Jeff
_______________________________________________
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.
_______________________________________________
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.