Re: NSOutlineView
Re: NSOutlineView
- Subject: Re: NSOutlineView
- From: Graham Cox <email@hidden>
- Date: Tue, 30 Dec 2008 20:49:59 +1100
On 30 Dec 2008, at 8:39 pm, Mahaboob wrote:
I'm calling this method from the action method that opens this
window. I
used the code:
- (IBAction) openMediaWindow: (id) sender
{
[cbChooseDatabase selectItemWithTitle:@"Default table"];
[self medialistSelectionChanged];
[OutlineView reloadData];
[MediaWindow makeKeyAndOrderFront:sender];
}
Not enough code here to get to the bottom of it, but can I take it you
are aware that windows are loaded lazily? In other words if you have a
window controller loaded from a nib, then the actual window is not
instantiated until it is first shown. Therefore you can't make any
calls to any objects such as views within it until it has been loaded.
Thus OutlineView will be nil until the window is shown for the first
time.
The window controller method - windowDidLoad: is what you need to get
around that - like -awakeFromNib it can be used to do initialisation
of the items in the window the first time it's shown. After that,
provided the window isn't released, you can access its controls as you
wish.
By the way you ought to use [NSWindowController showWindow] to make
the window visible as it may be doing more that just a call to -
makeKeyAndOrderFront:
hth,
Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden