• 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
How to remove items from NSCollectionView without view selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to remove items from NSCollectionView without view selection


  • Subject: How to remove items from NSCollectionView without view selection
  • From: Sandeep Mohan Bhandarkar <email@hidden>
  • Date: Mon, 17 Oct 2011 22:25:14 -0700

Hi All,

I have created a NSCollectionView currently i am able to add prototypeItems to this view. For removing items i have a "-" button which i have placed
in the prototypeItemView itself. I have also written an IBAction for its removal. It is as provided below


-(IBAction)removeAction:(id)sender
{

	NSIndexSet* selectedIndexSet = [_lablesCollectionView selectionIndexes];
	NSUInteger index = [selectedIndexSet firstIndex] ;
	NSLog(@"index is %d", index);
	[lablesArray removeObjectsAtArrangedObjectIndexes:selectedIndexSet];
}

Here lablesArray is an ArrayController object. This is working currently but i have to select the prototypeItem view first and then click on the "-" button. can some one tell me if
there is a way where in i can directly remove the item just by clicking on "-" and not selecting the prototypeItemView.


Sandeep Mohan Bhandarkar
408-859-6610
email@hidden



_______________________________________________

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

  • Follow-Ups:
    • Re: How to remove items from NSCollectionView without view selection
      • From: Ron Fleckner <email@hidden>
  • Prev by Date: preventing bad memory access
  • Next by Date: Re: preventing bad memory access
  • Previous by thread: Re: preventing bad memory access
  • Next by thread: Re: How to remove items from NSCollectionView without view selection
  • Index(es):
    • Date
    • Thread