Why am I receiving an error message when attempting NSScanner to use in a NSString statement?

I would like to know why I get an error message

Thread 1: Program received signal: "SIGABRT")

When I use this line of code:

NSScanner *userEntered = [[NSScanner alloc] scannerWithString:temp];

The error is:

2011-04-18 02:06:11.995 XXX[25929:207] -[NSConcreteScanner scannerWithString:]: unrecognized selector sent to instance 0x6816bc0 2011-04-18 02:06:11.999 XXX[25929:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSConcreteScanner scannerWithString:]: unrecognized selector sent to instance 0x6816bc0'

Thank you.

-------------Problems Reply------------

+scannerWithString is a class method and should be used the following way:

NSScanner *userEntered = [NSScanner scannerWithString:temp];

Category:objective c Views:0 Time:2011-04-18

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.147 (s). 11 q(s)