I have a NSMutableArray and need objects [0:5] only. Is there a simple way to slice? Can I drop all objects after index? Can I copy a sub-array to another NSMutableArray?
Use the instance method - (NSArray *)subarrayWithRange:(NSRange)range
.
For example:
NSArray* slicedArray = [wholeArray subarrayWithRange:NSMakeRange(0, 5)];