AFNetworking with JSONkit for iOS 4.x problem

When I try to build an app for iOS 5 to be compatible with iOS 4.x, I keep getting this error: “No JSON parsing functionality available”. After that I found out you need to add one of the following libraries to your project: JSONKit, SBJSON, or YAJL, according to https://github.com/AFNetworking/AFNetworking.

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.

I used JSONKit, but when I drag the library(JSONKit.h and JSONKit.m) in, it should auto detect the library. After I drag the library into the project, it doesn’t work at all, I still getting error: “No JSON parsing functionality available”.

Went to search on internet and troubleshoot for few hours, only to found out the project I build are with ARC support, and JSONKit is not. I have to disable ARC support for JSONKit to make the project compile with no problem.

After the changes, the project is able to run now. I am a happy man again :)

disabled ARC support for JSONKit.m, add -fno-objc-arc.



Leave a Comment