• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTableView and loadNibNamed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView and loadNibNamed


  • Subject: Re: NSTableView and loadNibNamed
  • From: Joseph Ayers <email@hidden>
  • Date: Sun, 04 May 2008 13:24:38 -0400
  • Organization: Northeastern University

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@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


--
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@hidden
http://www.neurotechnology.neu.edu/


_______________________________________________

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


References: 
 >Re: NSTableView and loadNibNamed (From: Keary Suska <email@hidden>)

  • Prev by Date: Using ObjC to access SOAP/WSDL server
  • Next by Date: Re: NSTableView and loadNibNamed
  • Previous by thread: Re: NSTableView and loadNibNamed
  • Next by thread: Re: NSTableView and loadNibNamed
  • Index(es):
    • Date
    • Thread