Re: NSTableView and loadNibNamed
Re: NSTableView and loadNibNamed
- Subject: Re: NSTableView and loadNibNamed
- From: Keary Suska <email@hidden>
- Date: Sun, 04 May 2008 10:11:46 -0600
- Thread-topic: NSTableView and loadNibNamed
on 5/4/08 9:14 AM, email@hidden purportedly said:
> I have a NSTableView as an instance of a NSWindowController declared as:
>
> @interface TableController : NSWindowController {
> IBOutlet NSWindow* tableWindow;
> IBOutlet NSTableView* dataTable;
> IBOutlet NSTableHeaderView* headers;
> IBOutlet NSTableColumn* column;
> }
>
> I read in the NIB using:
> [NSBundle loadNibNamed:@"tableWindow" owner:tableController]
Did you set the file's owner of the nib to your TableController class? Are
all the outlets connected? Is tableController non-nil when you call the
above method?
> Indeed the NIB tableWindow has file's Owner set to tableController and
> there is a connection made to dataTable
> from a TableController object.
>
> I get a pointer to tableController, but the field dataTable is nil.
What do you mean by "get a pointer to tableController"? How are you getting
the pointer? Should you have already created it before calling -loadNibNamed
? If your outlet is nil, it is not getting connected.
> How do I get dataTable to point to the NSTableView in the nib?
1. Set the "File's Owner" in the nib to your custom class
2. Connect the dataTable outlet to the NSTableView
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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