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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to