Mel
Mel

Reputation: 2075

doesnotrecognizeselector exception

Using NSXMLParser

why does this line of code cause an exception:

ushort crash = [[attributeDict objectForKey:@"a"] unsignedShortValue];

The value in the xml file is "0"

if I use integerValue it works

what is happening?

Upvotes: 0

Views: 1504

Answers (1)

Chuck
Chuck

Reputation: 237040

If you looked at the object throwing the exception, you would see it's something that doesn't have an unsignedShortValue method — I think NSString in this case.

Upvotes: 3

Related Questions