How to remove items from NSCollectionView without view selection
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