JSON library

64 views
Skip to first unread message

Xavier Vergés

unread,
May 9, 2013, 6:45:44 AM5/9/13
to cocotr...@googlegroups.com
Hello

I've tried building a project that was using JSONKit https://github.com/johnezang/JSONKit with no success, but I have not managed to make it link cleanly.

Any one has any recommendation for a JSON that will be nice to cocotron and me?

Thanks for your time.
-Xavier

Christopher Lloyd

unread,
May 9, 2013, 10:15:19 PM5/9/13
to cocotr...@googlegroups.com
Hm, what problems are you having with JSONKit? I haven't tried it but it looks like it doesn't have big dependencies.

Thanks,
Chris

Xavier Vergés

unread,
May 10, 2013, 12:09:39 AM5/10/13
to cocotr...@googlegroups.com
> Hm, what problems are you having with JSONKit?

I had to do some changes in order to compile it with cocotron, and they may be the root of the linking errors...

a) comment out
//#include <TargetConditionals.h>
//#include <AvailabilityMacros.h>


b) change errno.h location
/<sys/errno.h>/<errno.h>/

c) imported NSNumber.h, since I was getting 'NSNumber undefined'.

d) created a kCFNull global https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFNullRef/Reference/reference.html#//apple_ref/doc/uid/20001439-CH2g-DontLinkElementID_1

During linking, I get

Undefined reference to `_reallocf'
Undefined reference to `__imp__CFNumberCreate'
Undefined reference to `__imp__CFStringGetBytes'
Undefined reference to `__imp__CFStringGetMaximumSizeForEncoding'
Undefined reference to `__imp__CFNumberGetValue'



-Xavier

Xavier Vergés

unread,
May 29, 2013, 5:47:48 AM5/29/13
to cocotr...@googlegroups.com, uptim...@gmail.com
Thanks, I finally used SBJson too. Although it was an old version that was already included in the project that I'm migrating from iOS.

I had a small problem that could be easily bypassed: if the generated JSON is asked to be humanReadable, it ends up calling NSString stringByPaddingToLength, that is not implemented in Cocotron.

-Xavier

On Friday, May 10, 2013 8:57:05 AM UTC+2, uptim...@gmail.com wrote:
we use this JSSON library without any problems:

Xavier Vergés

unread,
May 29, 2013, 10:56:25 AM5/29/13
to cocotr...@googlegroups.com, uptim...@gmail.com
I'm wondering if you have done some patching to the library or cocotron, or if your JSON does not contain numbers, since the library uses
[NSDecimalNumber decimalNumberWithString:string]
that, as far as I see, is not implemented in cocotron
https://github.com/stig/json-framework/blob/master/src/main/objc/SBJsonStreamParser.m#L237

-Xavier

On Friday, May 10, 2013 8:57:05 AM UTC+2, uptim...@gmail.com wrote:
we use this JSSON library without any problems:

http://superloopy.io/json-framework/

Am Freitag, 10. Mai 2013 06:09:39 UTC+2 schrieb Xavier Vergés:
Reply all
Reply to author
Forward
0 new messages