KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In objectiveC I have an NSArray, let's call it NSArray* largeArray , and I want to get a new NSArray* smallArray with just the first x objects ...OR in the event that largeArray is already size <= x I just want a copy of the largeArray. So truncating any objects after index x. This approach: NSArray *smallArray = [largeArray subarrayWithRange:NSMakeRange(0, x)]; Was the answer to this very similar question . But it fails with an error if largeArray is already small.
Tags (comma-separated)
Save Edits
Cancel