I use JSONKit to convert data inside my .json file to NSMutableArray. How can i convert Array back to JSON data and write it to file? May be use some other Kits?
1 Answer
You can use SBJsonWriter class for this:
SBJsonWriter *writer = [SBJsonWriter new];
NSString *jsonString = [writer stringWithObject:yourArray];
You can find some help from Converting NSArray -> JSON -> NSData -> PHP server ->JSON representation
1 Comment
Ash Var
what if i want to make "arrayWithObject"? And how can I then write it to existings file here: NSString *path = [[NSBundle mainBundle] pathForResource:@"try" ofType:@"json"];