I am trying to capture the last x numbers of objects in an array and store them in another array.
How it works:
NSMutableArray *LastLines = [[LogLines subarrayWithRange:NSMakeRange(0, [LogLines count])] mutableCopy];
However, it is not:
NSMutableArray *LastLines = [[LogLines subarrayWithRange:NSMakeRange(([LogLines count]-4), [LogLines count])] mutableCopy];
and the following error appears in the log:
2013-03-13 15: 00: 43.475 [38565: 303] * - [Subarray NSArrayWithRange:]: the range {83255, 83259} is outside the range [0 .. 83258]
However, the range seems like it should fall within the boundaries, so I'm not sure why it is giving this error.
Prognastat
source share