Skip to content

Instantly share code, notes, and snippets.

@Alos
Created September 27, 2008 19:34
Show Gist options
  • Save Alos/13359 to your computer and use it in GitHub Desktop.
Save Alos/13359 to your computer and use it in GitHub Desktop.
/**
Removes selected items
*/
-(void)removeSelectedItems{
var indexes= [collectionView selectionIndexes];
var arr = [[CPArray alloc]init];
var a = [[collectionView selectionIndexes] firstIndex];
var b = [[collectionView selectionIndexes] lastIndex];
[indexes getIndexes: arr maxCount: a inIndexRange: CPMakeRange(0, b)];
for(var i=0; i< [arr count];i++){
[model removeObjectAtIndex: [arr indexOfObject: i]];
[collectionView reloadContent];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment