Skip navigation.
 
mlRe: Problems with [NSArray count]
FROM : Shawn Erickson
DATE : Tue Apr 22 23:14:07 2008

On Tue, Apr 22, 2008 at 2:10 PM, Shawn Erickson <<email_removed>> wrote:
> On Tue, Apr 22, 2008 at 2:03 PM, Peter Browne
>  <<email_removed>> wrote:
>  > Hi,
>  >
>  >  I'm returning to Cocoa after quite a long break, and it seems that I'm a
>  > little rusty...
>  >
>  >  All I want to do is find out the number of items in an NSArray and store
>  > that as a variable, which I can then find the square root of.
>  >
>  >  The docs tell me that [NSArray count] returns an NSUInteger, but exactly
>  > WHAT one of these is, or how I use it is baffling me.
>  >
>  >  a simple
>  >
>  >        int i = [myArray count];
>  >
>  >  crashes out, and I've tried various other types of variable to no avail.
>  > Any thoughts? Am I missing something blindingly obvious here?
>
>  NSUInteger is either "unsigned int" in the 32 bit runtime or "unsigned
>  long" in the 64 bit runtime.


Also when in doubt about what a type is defined as command double
click the type name in source to bring up the definition (or
right-click jump to definition).

-Shawn

Related mailsAuthorDate
mlProblems with [NSArray count] Peter Browne Apr 22, 23:03
mlRe: Problems with [NSArray count] Shawn Erickson Apr 22, 23:10
mlRe: Problems with [NSArray count] Shawn Erickson Apr 22, 23:14
mlRe: Problems with [NSArray count] David Duncan Apr 22, 23:15
mlRe: Problems with [NSArray count] Andy Lee Apr 22, 23:19
mlRe: Problems with [NSArray count] Peter Browne Apr 22, 23:45
mlRe: Problems with [NSArray count] Hamish Allan Apr 22, 23:57
mlRe: Problems with [NSArray count] Shawn Erickson Apr 23, 00:04
mlRe: Problems with [NSArray count] David Duncan Apr 23, 01:08