gowalla/AFNetworking — Issue #79: Foundation JSON handling is silly. (Pull request)
Author: zbowling
Created: 2011-10-18 23:42:21+00:00
State: open

The ifdefs for how JSON is handled currently attempt to loosely fallback to JSONKIt. This is unsafe and not very well thought out. The user of the library should really be explicit if wants to add the extra JSONKit dependency or just use Foundation JSON and they should use only one library instead of trying to fallback.

The reason is that the two are not perfectly compatible in what they return. Both have subtle differences that can turn into weird bugs for the developer getting something they didn't expect. On top of that, JSONKit is dramatically faster so doing it as fallback after Foundation JSON seems silly.

I think that instead of requiring JSONKit in both situations, allow the user to choose if he wants to add an extra dependency or not to his project. I'm perfectly happy with the built in slower Foundation's JSON support only to reduce my app size and not have to configure another set of files not to build with ARC in my project.