removing item from NSTreeController or NSOutlineView
removing item from NSTreeController or NSOutlineView
- Subject: removing item from NSTreeController or NSOutlineView
- From: Steven Crosley <email@hidden>
- Date: Wed, 28 Nov 2007 21:23:49 -0600
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:
This email sent to email@hidden