How to count the number of elements in NSArray?

I want to count the number of elements in NSArrayand perform some operation based on this. I know that it doesn’t matter, but I couldn’t understand it.

Please give some suggestions.

+5
source share
4 answers

It is very simple:

int arrayLength = array.count;
+29
source

[yourNSArrayReference count]; It is simple: =)

+4
source

Very simple: -

[*your array name* count];
+3
source

you just need to check

[number of arrays];

+1
source

All Articles