I have NSMutableArray of Results it has 6 items. I want to copy the first three contents
to another NSArray.
Just use subarrayWithRange::
NSMutableArray *oldArray = ... // the mutable array with the 6 objects
NSArray *result = [oldArray subarrayWithRange:NSMakeRange(0, MIN(3, oldArray.count))];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With