Re: Is there an easier way of changing NSButtonCell state in an NSOutlineView
Re: Is there an easier way of changing NSButtonCell state in an NSOutlineView
- Subject: Re: Is there an easier way of changing NSButtonCell state in an NSOutlineView
- From: Quincey Morris <email@hidden>
- Date: Thu, 24 Nov 2011 09:47:14 -0800
On Nov 24, 2011, at 05:46 , Gilles Celli wrote:
> My hierearchical list will not changed or sorted in the NSoutlineView….that's why I was thinking to use NSArray for the buttons.
In your scenario -- where the list is "really" flat but displayed hierarchically for esthetic reasons -- the array approach is fine.
> However if I want to do it correctly, should I add an ivar like BOOL isChecked to my OvItem class ? So I won't need an NSArray
>
> Like this:
>
> @interface OvItem : NSObject {
>
> NSString *name;
> NSMutableArray *children;
> BOOL isGroup;
> BOOL isChecked; // For NSButtonCell in the NSOutlineView
> }
>
> Do you think this is a better idea than using NSArray ?
If you're *already* using these OvItem objects, then I'd say it's worth doing this. It makes things a bit clearer when you (or someone else) return to the code in the future. It would probably also allow you to simplify your 'outlineView:objectValueForTableColumn:byItem:' method a bit.
_______________________________________________
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