1

I'm getting EXC_BAD_ACCESS (code=EXC_I368_GPFLT) when trying to serialize dictionary that contains NSNumber using JSONKIT

I got the exception in method called jk_encode_add_atom_to_buffer in the following line

void  *objectISA = (JK_EXPECT_F(workAroundMacOSXABIBreakingBug)) ? NULL : *((void **)objectPtr);

here is sample code i tried

NSDictionary *dict = @{@"StringKey":@"Value", @"NumberKey" : @5};
NSString* reqString = [dict JSONStringWithOptions:JKSerializeOptionNone error:&jsonError];

is there is any hint why I'm getting this error?

Mahmoud Adam
  • 5,772
  • 5
  • 41
  • 62
  • With the quoted line, I'm not surprised that it crashes, I'm surprised that it ever worked. What the hell are these guys doing? I'd strongly recommend using NSJSONSerialization. – gnasher729 Sep 23 '15 at 08:35

1 Answers1

1

I don't know if you found out the answer to your problem as it's an old post, but I got the same error and I fixed it by using this version of JSONKit:

https://github.com/danielStokowski/JSONKit

Use this one instead of the old one and you will no longer have this error.

ahmacleod
  • 4,280
  • 19
  • 43
HapinUse
  • 21
  • 2