Sorry if this is a bit of a mess, it's my first pull request.
objectPtr in jk_encode_add_atom_to_buffer refers to the original object and never changes. After the unsupported Class delegate method gets called, object is updated to a new, serializable object but the code still uses objectPtr which messes up the objectISA assignment.
I believe the correct course of action is to use object for the objectISA call.
The other commit is just adds an addObject: method for JKArray.
Add addObject method for JArray
Fix bug where jk_encode_add_atom_to_buffer does not look at the prope…
…r object after handling an unsupported class.
There are a number of compiler issues with XCode 4.5b4 (and previous betas I assume) regarding JSONKit.
The isa thing being the more worrying, but the change is rather easy to deal with. Changes from object->isa to object_getClass(object):
*** /Volumes/Ackbar/XData/XUsers/mouser/Dev/Oracle/Vulcan/ios/3rdparty/JSONKit/JSONKit.m 2012-08-13 14:47:41 +0000
--- /Volumes/Ackbar/XData/XUsers/mouser/Dev/Oracle/wc_rtc/ios/shared/src/JSONKIT/JSONKIT.m 2012-01-11 13:43:30 +0000
*** 742,750 ****
--- 742,750 ----
The other is misuse of printf format hints like %lu (unsigned long) when passing NSUInteger (unsigned int). I changed those to
I'm having the same issue. Your fix 785411e fixed the problem.
Awesome, the updated .m fixed the issues. I found I could not simply do a search & replace on ->isa like you said, because in some cases it was used on an expression result other than 'object', but the download of your new .m is solid. Thanks for sharing such a great resource!