I'd like to limit the output of an NSArray.
If my NSArray has, say 5 NSStrings in it:
NSArray *alphaList = [NSArray arrayWithObjects:@"v", @"w", @"x", @"y", @"z", nil];
Obviously coding:
NSLog(@"%@", alphaList);
Will output all 5 NSString objects.
I'm wondering if there's a way to limit the output to "n" number of objects.
I was hoping there'd be a way to do this through adding a number to the format specifier but it doesn't look like that's possible.
Any suggestions?
NSLog(@"%@", [alphaList subarrayWithRange:NSMakeRange(0, n)]);
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