0

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

4
  • put you maximum code for mure understanding :) Commented Feb 7, 2013 at 14:59
  • I would suggest moving your JSON parsing to Apple's NSJSONSerialization class. It looks like the library you are using is out of date and deprecated. Commented Feb 7, 2013 at 15:02
  • "When compiling I obtained this error" - I didn't know clang used CJSONDeserializer internally... Commented Feb 7, 2013 at 15:31
  • That error message is quite specific. Somewhere you invoked the method scannerWithData passing a "this" pointer that was a CJSONScanner object. And CJSONScanner does not implement scannerWithData. Find out where in your code you're invoking scannerWithData. (And, as others said, this is a runtime error, not a compile error.) Commented Feb 7, 2013 at 22:31

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.