Skip navigation.
 
mlRe: NSTableView and loadNibNamed
FROM : Joseph Ayers
DATE : Sun May 04 19:24:38 2008

The method that loads the NIB is:

-(void)loadTableController{
    if (tableController == NULL) {
        tableController = [[TableController alloc] init];
        if (![NSBundle loadNibNamed:@"tableWindow" owner:tableController]) {
        NSLog(@"Error loading TableController");}
        else{
            NSLog(@"TableController NIB Loaded");     
        }
        [tableController loadWindow];
    }     
}

After the aloc init step
tableController is 0x380060
dataTable is 0x0

At a break at the NSLog(@"TableController NIB Loaded") call
the values are unchanged

indeed, the file's Owner is TableController and dataTable is connected
to the NSTableView object in the NIB.

Thanks,
Joseph Ayers

Keary Suska wrote:
> on 5/4/08 9:14 AM, <email_removed> 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_removed>)
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>
>



--
Joseph Ayers, Professor
Department of Biology and
Marine Science Center
Northeastern University
East Point, Nahant, MA 01908
Phone (781) 581-7370 x309(office), x335(lab)
Cellular (617) 755-7523, FAX: (781) 581-6076
Boston Office 444RI, (617) 373-4044
eMail: <email_removed>
http://www.neurotechnology.neu.edu/

Related mailsAuthorDate
mlNSTableView and loadNibNamed Joseph Ayers May 4, 17:14
mlRe: NSTableView and loadNibNamed Keary Suska May 4, 18:11
mlRe: NSTableView and loadNibNamed Joseph Ayers May 4, 19:24
mlRe: NSTableView and loadNibNamed Hamish Allan May 4, 20:36
mlRe: NSTableView and loadNibNamed Joseph Ayers May 4, 21:21