0

On my iPhone app, I'm getting this response from the server: Server JSON response

I need to save this data to disk, so it can be accessed while offline, and am doing it with NSKeyedArchiver.

I need to save each id_preguntawith its correspondent values, including the array respuestas, which has some objects, too.

How can I break this server response into more manageable data, so I can save it? My current approach is using NSMutableDictionary, but I just can't understand the logic behind this (I'm way too tired).

Thanks in advance.

2 Answers 2

1

If you were to serialize this into NSMutableDictionary you could just write the contents of the dictionary to a file. If you need to parse the data into objects (for whatever reason) or you want the general scalability and performance of a database you may want to look at this link to -> Core Data.

However; you did not specify in what form you want the data.

Frank

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

Comments

0

See these in NSDictionary class reference...

 - (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag

and

+ (id)dictionaryWithContentsOfFile:(NSString *)path`

Comments

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.