Re: OutlineView Wierdness - 'item' not being stored.
Re: OutlineView Wierdness - 'item' not being stored.
- Subject: Re: OutlineView Wierdness - 'item' not being stored.
- From: Graham Cox <email@hidden>
- Date: Wed, 26 May 2010 22:27:01 +1000
On 26/05/2010, at 10:12 PM, Pascal Harris wrote:
> - (id)outlineView:(NSOutlineView *)outlineView
> objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
> {
> if ([[[tableColumn headerCell] stringValue] compare:@"Key"] ==
> NSOrderedSame)
> {
I'm not sure what the problem is, but the code is a mess, which will probably explain much of it.
If you can't reduce this method to:
- (id) outlineView:(NSOutlineView*) outlineView objectValueForTableColumn:(NSTableColumn*) tableColumn byItem:(id) item
{
return [item valueForKey:[tableColumn identifier]];
}
Then your controller design should be looked at and reorganised until you can. It might mean wrapping up certain elements of your data model into "presentable" objects that can be passed to the outline view and treated consistently. Outline views become ultra-easy when you do this.
I'd also be very wary of writing files in any of these methods, even for test purposes.
--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