Re: NSTableView Problems
Re: NSTableView Problems
- Subject: Re: NSTableView Problems
- From: Barry Fawthrop <email@hidden>
- Date: Mon, 24 Nov 2008 09:28:36 -0500
To All
Thank You
My main problem was I did not set Identifiers in the IB for the
tableColumns So I could not reference each column
Having set that and using an NSMutableDictionary
helped to get what I was needing.
Thank you for your input it sure helped me grasp the concepts
Barry
Barry Fawthrop wrote:
> Thank You
> my datasource methods are as follows:
>
> -(int) numberOfRowsInTableView:(NsTableView *)table {
> return [schedule count];
> }
>
> -(id)talbeview: (NSTableView *)table objectValueForTableColumn:
> (NSTableColumn *)col: row:(int)row {
> return [schedule objectAtIndex: row];
> }
>
> 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 ?
>
> Would this met your suggestion on a object class?
>
> Thanks again
> Barry
>
> Graham Cox wrote:
>> On 24 Nov 2008, at 10:43 am, Graham Cox wrote:
>>
>>>> [schedule addObject: [NSArray arrayWithObjects: @"TIME", filename,
>>>> length, nil]];
>>
>> A further comment.
>>
>> While managing your data this way is OK, and may fit your application
>> well, I personally wouldn't do it this way.
>>
>> Instead, define an object class that has a filename, length and time
>> values as properties. Then your list becomes trivially easy to manage as
>> each related piece of data is always held together. In other words a
>> general-purpose array is not a good substitute for a custom object that
>> links the various bits of data together meaningfully.
>>
>> You'll also find that driving a table view is much easier - the code
>> snippet I posted always works when you do it this way, provided your
>> write your property accessors correctly.
>>
>>
>> hth,
>>
>>
>> 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
_______________________________________________
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