• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
removing item from NSTreeController or NSOutlineView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: NSTextView and Click on Button
  • Next by Date: Re: NSTrackingArea + cursorUpdate: problem
  • Previous by thread: Re: NSPredicate and square brackets
  • Next by thread: Why does [someObj msgA:@"xyx"] not give my expected result
  • Index(es):
    • Date
    • Thread