Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

BollywooD

macrumors 6502
Original poster
Apr 27, 2005
369
46
Hamburg
how do I return an NSArray of all the root objects in my NSTreeController?
this should be simple?

this is the code I have tried....

Code:
NSArray *myArray = [[self myTreeController] allObjects];

and this:

Code:
NSArray * myArray = [myTreeController content];

Im stumped....
 

BollywooD

macrumors 6502
Original poster
Apr 27, 2005
369
46
Hamburg
Doh!

Code:
NSMutableArray * myArray = [NSMutableArray array];
	for (id node in [myTreeController content])
	{
		[myArray addObject:[node valueForKey:@"key"]];
	}
	return myArray;
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.