Re: Follow up: setDoubleAction: for NSTableView
Re: Follow up: setDoubleAction: for NSTableView
- Subject: Re: Follow up: setDoubleAction: for NSTableView
- From: Brian Webster <email@hidden>
- Date: Sat, 23 Jun 2001 14:09:21 -0500
On Saturday, June 23, 2001, at 02:01 AM, cocoa-dev-
email@hidden wrote:
The cells on the table being double clicked on are not editable.
In IB, the target is set to my single click method.
The following lines of code is in the - init for the controller class:
[masterTableView setTarget:self];
[masterTableView setDoubleAction:@selector(handleTVDoubleClick:)];
When a nib is loaded, the outlets and actions of the objects
aren't hooked up until after all the objects have been
initialized, so the reason that this is not working is because
masterTableView is still nil in -init. You should move any
initialization code that relies on IB connections to the
-awakeFromNib method, which is called on all objects
instantiated from a nib after all the connections are hooked
up. Also, I don't know if you're using NSWindowController or
not, but if you are, then you should put the code in the
-windowDidLoad method, since the window isn't loaded from the
nib until needed, so -awakeFromNib in an NSWindowController is
still too early to access nib objects.
--
Brian Webster
email@hidden
http://www.owlnet.rice.edu/~bwebster