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

后端 未结 3 2014
无人及你
无人及你 2021-01-13 09:27

I get the following error when testing on iOS4:

dyld: Symbol not found: _OBJC_CLASS_$_NSJSONSerialization

While on iOS5 it\'s wo

相关标签:
3条回答
  • 2021-01-13 10:12

    @hoshi is right. You can't use NSJSONSerialization on devices running older than iOS 5.0.

    Here's the documentation from Apple's site. For my own code I also use the SBJson library.

    0 讨论(0)
  • 2021-01-13 10:17

    Seems to be that the AFNetworking class is the one that use NSJSONSerialization.

    0 讨论(0)
  • 2021-01-13 10:24

    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

    1. that JSONKit / SBJson / YAJL are included
    2. 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.

    0 讨论(0)
提交回复
热议问题