className method?

Posted by fuzzygoat on Stack Overflow See other posts from Stack Overflow or by fuzzygoat
Published on 2010-06-07T16:17:31Z Indexed on 2010/06/07 16:22 UTC
Read the original article Hit count: 241

Filed under:
|
|

I have just been watching the Stanford iPhone lecture online from Jan 2010 and I noticed that the guy from Apple keeps referring to getting an objects class name using "className" e.g.

NSArray *myArray = [NSArray arrayWithObjects:@"ONE", @"TWO", nil];
NSLog(@"I am an %@ and have %d items", [myArray className], [myArray count]);

However, I can't get this to work, the closest I can come up with it to use class, is className wrong, did it get removed, just curious?

NSArray *myArray = [NSArray arrayWithObjects:@"ONE", @"TWO", nil];
NSLog(@"I am an %@ and have %d items", [myArray class], [myArray count]);

Gary

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c