Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 7. Working with Collections > Manipulating Indexes

Manipulating Indexes

From: indexset.m

13 NSMutableIndexSet *indexSet =
14   [NSMutableIndexSet indexSetWithIndex: 1];
15 [indexSet addIndexesInRange:
16   NSMakeRange(5, 20)];
17 [array removeObjectsAtIndexes:
18   indexSet];

Arrays are indexed by integers. Often, you want to do some operation on a group of values in an array. A special class, called NSIndexSet, is used for storing groups of indexes. Internally, this stores a set of ranges, so can be quite dense.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint