Re: Re: Getting an NSOutlineView Item's parent
Re: Re: Getting an NSOutlineView Item's parent
- Subject: Re: Re: Getting an NSOutlineView Item's parent
- From: Perrog <email@hidden>
- Date: Fri, 20 Oct 2006 00:21:43 +0200
2006/10/18, Scott Stevenson <email@hidden>:
It's sounds like you're just using Foundation classes in the view at
the moment (dictionaries, arrays, strings), but it would probably be
easier to make a custom class which contains the dictionaries and
arrays.
To write a generetic data source for objects like dictionaries,
arrays, etc. you can also address your data with a string (or key
path), and let the string represent the item.
For example, the following items represents an "address" to an object.
"rootObject.MyKey" -> [rootObject objectForKey:@"MyKey"]
"rootObject.MyKey.2" -> [[rootObject objectForKey:@"MyKey"] objectAtIndex:2]
You will have to take care of the item string retain and release
yourself, since NSOutlineView doesn't do that; when creating them, add
it to a "garbage array".
You will have to write your own code for evaluating "rootObject.MyKey"
as the statement [rootObject objectForKey:@"MyKey"], but it turns out
to be trival code.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden