Posted By

rabc on 10/30/10


Tagged

iphone nsmutablearray NSRange NSArray


Versions (?)

Clear array by range


 / Published in: Objective C
 

  1. // Starting at position 20, get others characters
  2. NSRange range = NSMakeRange (20, ([array count]-20));
  3. NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:range];
  4. [array removeObjectsAtIndexes:indexSet];

Report this snippet  

You need to login to post a comment.