johnezang / JSONKit

Objective-C JSON
6.21k stars 1.66k forks source link

crash with iOS9 Xcode7 #186

Open Baoge2012 opened 9 years ago

Baoge2012 commented 9 years ago

NSString str = @"{\"123123\":\"1\"}"; NSDictionary jsonObj = [str objectFromJSONString]; [jsonObj JSONData];

crash on [jsonObj JSONData]; only who know how to solve this?

default

devedup commented 8 years ago

I just ditched JSonKit completely and replaced with the Foundation version:

NSError *error = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:str
                                                      options:NSJSONWritingPrettyPrinted error:&error];
if (!jsonData) {
    NSLog(@"Error creating JSON object %@", error);
}

and

NSError* error;
NSDictionary *result = [NSJSONSerialization
                                          JSONObjectWithData:data
                                          options:kNilOptions 
                                          error:&error];
glb888 commented 8 years ago

X

jcbertin commented 8 years ago

See #158.

Baoge2012 commented 8 years ago

@devedup I did that too.

ElleSkye117 commented 8 years ago

Migrate away from jsonkit. This library hasn't been updated in years.