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: Quincey Morris <email@hidden>
- Date: Tue, 28 Jul 2009 11:41:23 -0700
On Jul 28, 2009, at 11:04, Daniel Child wrote:
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?
Incidentally, the correct prototypes for these methods have as their
last parameter ...
row: (NSInteger) index
The difference would only be important if your app was being built as
64-bit. If so, with your prototypes, NSTableView might reject the data
source method signatures. Did you check for messages in the run log?
(Either check the debugger's run log window in Xcode, or use the
Console utility to check the system log.)
It's worth emphasizing that in Cocoa frameworks-related code, 'int' or
'unsigned' ought to be a huge red flag to the wary programmer, with a
possible transition to all-64-bit-all-the-time looming on the horizon.
And that the documentation is still sometimes wrong about the
prototypes for delegate method signatures (and often wrong for
didEnd... method signatures).
_______________________________________________
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