Getting dyld: Symbol not found: _OBJC_CLASS_$_NSJSONSerialization on IOS4

ios4, iphone

Solution

From the AFNetworking README :

"AFNetworking uses NSJSONSerialization if it is available. If your app targets a platform where this class is not available you can include one of the following JSON libraries to your project for AFNetworking to automatically detect and use."

With that being said, to prevent the following error make sure of two things

- that JSONKit / SBJson / YAJL are included

- That your "Deployment Target" is lower than iOS5 , that way `AFNetworking` would realize it can't use `NSJSONSerialization` and will fall back to one of the included JSON parsing classes.

Shai.

Problem

I get the following error when testing on iOS4: dyld: Symbol not found: _OBJC_CLASS_$_NSJSONSerialization While on iOS5 it's working fine. Any help will be appreciated.

Original source