I have a NSMutableArray
whose count is 10 and I want to extract the last 5 values and store them in another array. How can I do this?
相关问题
- Image loads in simulator but not device?
- NSOutlineView drag line stuck + blue border
- UIModalTransitionStyleFlipHorizontal flips Vertica
- Split list of elements into groups
- Xcode4 templates now use underscore on iVars?
相关文章
- Xcode: Is there a way to change line spacing (UI L
- Converting (u)int64_t to NSNumbers
- How to access value of first index of array in Go
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- “getter” keyword in @property declaration in Objec
- How to get a CGImageRef from Context-Drawn Images?
- Why does slice [:-0] return empty list in Python
- NSMenuItem KeyEquivalent “ ”(space) bug
Use following way :
You can use subarrayWithRange method to get the desired arraydata. Try this hopefully it will work.
I think that
- (NSArray *) subarrayWithRange:(NSRange)range
(doc) might help you.EDIT : Be careful to check that your array has at least five elements, else,
subarrayWithRange
will throw an exception.