Re: How to remove items from NSCollectionView without view selection
Re: How to remove items from NSCollectionView without view selection
- Subject: Re: How to remove items from NSCollectionView without view selection
- From: Ron Fleckner <email@hidden>
- Date: Tue, 18 Oct 2011 16:49:50 +1100
On 18/10/2011, at 4:25 PM, Sandeep Mohan Bhandarkar wrote:
> 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.
>
Hello, Sandeep,
Not sure, but I think have a look at -acceptsFirstMouse.
Ron
_______________________________________________
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