nsindexset

Get NSIndexSet from NSArray

NSArray has useful methods to find objects for specified indexes // To find objects by indexes - (id)objectAtIndex:(NSUInteger)index - (NSArray *)objectsAtIndexes:(NSIndexSet *)indexes // To find index by object - (NSUInteger)indexOfObject:(id)anObject However, I want to get NSIndexSet (multiple indexes) for given objects. Something ...

Deleting UITableView sections combined with custom section headers UIViews = bug in Apple's code?

I'm trying to delete a section from a UITableView using animation and custom table section header UIViews. I use... //Deletion from my model done here (not shown) and then perform the deleteSections... [self.tableView beginUpdates]; [self.tableView deleteSections:[NSIndexSet indexSetWithIndex:index] withRowAnimation:UITableViewRow...

How to get indexes from NSIndexset into an NSArray in cocoa?

I'm getting the select items from a table view with: NSIndexSet *selectedItems = [aTableView selectedRowIndexes]; what's the best way to get the indexes in a NSArray object? ...

indexSetWithIndexesInRange is not doing what expected

I want to select some objects from an array. Therefore I'm using begin and end indexes of my selection. NSLog(@"start:%d\nend:%d", startIndex, endIndex); NSIndexSet *myIndexes = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(startIndex, endIndex)]; NSLog(@"%d", [myIndexes lastIndex]); The first NSLog gives me startIndex:49 ...