Re: NSTableView questions
Re: NSTableView questions
- Subject: Re: NSTableView questions
- From: Hrishikesh Muruk <email@hidden>
- Date: Sun, 7 Oct 2007 22:54:01 +0530
I added a public member to my dataSrc class (edited the .h file)
IBOutlet NSTablView *myTable;
But I don't see that outlet when I open the .nib file.
Is adding the outlet using Interface builder the only option? Then I
would have to re-instantiate the c\object, redo all connections, and
generate source files again. Is there an easier way?
Thanks
Hrishi
On 06-Oct-07, at 6:00 PM, Uli Kusterer wrote:
Am 05.10.2007 um 18:58 schrieb Chris Williams:
- You get a reference to the NSTableView by declaring a variable
as such:
(IBOutlet) NSTableView *myTable;
and connecting it in the Interface Builder. It isn't unreasonable to
declare this as an Extern even, and reference it from several code
modules.
Are you sure this will compile? I never heard about being able to
use "extern" with an outlet, and the brackets shouldn't work
either. IBOutlet is only a marker that you put next to *instance*
variables of objects (i.e. instances), so that when you drag the
header onto one of Interface Builder's NIB windows to have it
parsed, it'll know that this instance variable is supposed to be an
outlet and that you want to be able to hook up another object in
the NIB to it.
So yes, IBOutlet is what Hrishikesh will want to use here. But
extern and regular variables don't enter the picture here. ALso, an
extern isn't really a good design anyway. Use an accessor method on
the object here.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
---
www.greenwaysroad.com
_______________________________________________
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