user2051214
user2051214

Reputation: 11

exception error with json in xcode

I'm beginner in ios. I developing a call with JSON for access a data and insert after on UITableView. In this point on my code

    NSDictionary * dict = [[CJSONDeserializer deserializer ] deserialize:jsonData error:&error];

When compiling I obtained this error

2013-02-07 15:49:48.078 comercMobil[12933:c07] +[CJSONScanner scannerWithData:]: unrecognized selector sent to class 0xe7b8
2013-02-07 15:49:48.080 comercMobil[12933:c07] Exception +[CJSONScanner scannerWithData:]: unrecognized selector sent to class 0xe7b8

any suggestions? thanks for all

Upvotes: 0

Views: 162

Answers (1)

Rob
Rob

Reputation: 437422

A couple of things:

  1. This is not a compiler error, but rather a runtime error.

  2. I don't think this is the line that's causing this error, since you're not calling scannerWithData here. I'd search your source for a reference to scannerWithData.

  3. But, I agree with Sean that you should consider just using NSJSONSerialization.

    NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data
                                                         options:0
                                                           error:&error];
    

    Or, if you need support for iOS prior to version 5.0, SBJSON is very popular.

Upvotes: 1

Related Questions