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?
NSMutableArray
You can use subarrayWithRange method to get the desired arraydata. Try this hopefully it will work.
if (yourMutableArray.count > 10) { NSArray *newArray = [yourMutableArray subarrayWithRange:NSMakeRange(yourMutableArray.count-10, yourMutableArray.count-1)]; }