Re: NSTableView Problems
Re: NSTableView Problems
- Subject: Re: NSTableView Problems
- From: Graham Cox <email@hidden>
- Date: Mon, 24 Nov 2008 14:57:09 +1100
On 24 Nov 2008, at 11:21 am, Barry Fawthrop wrote:
-(id)talbeview: (NSTableView *)table objectValueForTableColumn:
(NSTableColumn *)col: row:(int)row {
return [schedule objectAtIndex: row];
}
This won't work. For one thing it's completely misspelt - that might
be a mail error, but if not then you need to fix it - exact spelling
of method names is vital.
But assuming that's not the problem...
As each object in your 'schedule' array is also an array, why would
you expect the table view to know what to do with it? You need to
match the object class to the one expected by the cells in each table
column. There is no standard table column cell type that can accept a
general array, nor would it be really possible to design one.
The problem here is that you're not actually returning to the table
view a single object that is appropriate to the table column. In fact
you are ignoring the table column parameter to this method. I think
you need to go back and re-read all of the table view programming
topics here, as you have some basic misunderstandings.
http://developer.apple.com/documentation/Cocoa/Conceptual/TableView/Concepts/AboutTables.html#/
/apple_ref/doc/uid/20000115
Can/Should I perhaps add a second controller, this time an Array
Controller (the current one is NSObject based),
And use just the Array Controller for the NSTableView ?
No, adding complexity to something you already don't understand won't
magically fix it. Go back, learn the subject, figure out what you're
doing. That will fix it (eventually).
Would this met your suggestion on a object class?
No.
--Graham
_______________________________________________
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