0

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?

0

1 Answer 1

0

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

SBJsonWriter Nested NSDictionary

Sign up to request clarification or add additional context in comments.

1 Comment

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"];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.