Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

removing item from NSTreeController or NSOutlineView



I've been looking at the SourceView sample code and was wondering how I would create a custom remove method. For example, I don't want to remove certain nodes, so what I want to do is check if the node isSpecialGroup (a node that should not be removed) and remove the node if it is not. I'm not sure if I need to remove this from the Tree Controller or the outlineView or both. I started doing something like the method below, but I'm pretty sure I'm way off, any help would be much appreciated!

// -------------------------------------------------------------------------------
// remove:
// -------------------------------------------------------------------------------
- (void)remove:(id)sender
{
NSArray *selectedItems = [treeController selectedObjects];
int i;

for (i=0; i<[selectedItems count];i++){
if([self isSpecialGroup [selectedItems objectAtIndex:i]] == YES){
[treeController remove:sender];
}
}

}


Thanks,
Steven

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.