Re: NSWindow reference remains null after window did load
Re: NSWindow reference remains null after window did load
- Subject: Re: NSWindow reference remains null after window did load
- From: Daniel Child <email@hidden>
- Date: Tue, 28 Jul 2009 14:04:58 -0400
I decided the nib was maybe corrupt from my having dragged things from
another project onto it. So I started with a fresh xib, got rid of the
redundant object (as pointed out by Graham Cox and yourself) and
voila: I have references to the tableview and the window. But it's
still not working.
The only datasource method to get called is numberOfRowsInTableView.
The others do not get called. I rechecked syntax (even tried copying
method sig from another project that works), rechecked connections for
the outlets (File's Owner to the table, and table delegate and data
source to File's Owner, which is the window controller). Still,
- (id) tableView: (NSTableView *) tableView
objectValueForTableColumn: (NSTableColumn *) tableColumn
row: (int) row
and
-(void) tableView: (NSTableView*) tableView
setObjectValue: (id) value
forTableColumn: (NSTableColumn*) tableColumn
row: (int) index
never get called. I also tried [myTable reloadData] when resizing the
table (resizing works) but that did nothing. References to the
individual columns appear to be valid based on log statements (I
cached the column references for convenience), but it's irrelevant
because a log at the start of each of the above datasource methods is
never printed. As a result, nothing is loaded in the table, and I
cannot select individual cells.
What would cause this?
On Jul 28, 2009, at 11:39 AM, Dave Carrigan wrote:
On Jul 28, 2009, at 8:31 AM, Daniel Child wrote:
Which brings up another question: do I need the "object" (blue
cube) at all in the nib if the file's owner is of the same class
and presumably represents the same object. Are they redundant?
They are completely different things.
The blue cube object will cause a brand new object to be
instantiated when the nib is loaded.
The file's owner is a pseudo-object - it represents an object
external to the nib that has already been instantiated before the
nib gets loaded.
This almost certainly explains why you seem to have two different
objects of the same class.
--
Dave Carrigan
email@hidden
Seattle, WA, USA
_______________________________________________
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