views:

148

answers:

2

Hi, I was wondering if there was any possible way to get the number (count) of objects in an NSArray Object

+13  A: 

You bet! From Apple's documentation:

NSUInteger numObjects = [myArray count];
e.James
Thanks! This is just what I needed.
Mr. Man
You're welcome. In future, it may be easier (and quicker) to look these things up in the documentation. Apple has an extensive reference library which can come in very handy, especially for the basics of how the built-in classes work. I don't want to discourage you from asking questions, though. Just a productivity tip to keep in mind for next time. Have fun with your code :)
e.James
+2  A: 

Yes: int count = [array count];

Alexsander Akers
Try to use `NSUInteger` instead of `int`.
Jed Smith