JSONKit provides awesome way to decode JSON file, what is the best way to do the opposite way to encode objects to JSON file ?
BTW: Here is tutorial for loading & saving with XML.
Thanks
iOS 5 now has everything needed to do that :
NSError *error = nil;
NSOutputStream *outputStream = [NSOutputStream outputStreamToFileAtPath:filepath append:yesOrNo];
[outputStream open];
[NSJSONSerialization writeJSONObject:nsDicOrNSArrayObject
toStream:outputStream
options:0
error:&error];
[outputStream close];
JSONKit also has everything you need to retrieve a JSON value from NSArrays and NSDictionarys.
NSString *jsonString = [yourDictionary JSONString];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With