Sync ios nsuserdefaults

Hi, I have arrays stored in NSUserDefaults in my ios application. I want to create two-way synchronization to receive data from sql server and save it in this database, and also update the server using this database. How should I do it?

+3
source share
1 answer

You can explain a little better. I think I understand what you are trying to do.

First you need to create a server-side page that displays the data that you want to save on the iPhone, in NSUserDefaults. I would recommend that the page display the output in json format and then use a Parser JSON library such as SBJSON to parse the data in NSArray, after which you save this information in NSUserDefaults. You can use to get this data NSURLConnection.

To send data to the server, you need to use NSURLConnectionto send data to the server using the POST or GET methods.

+1
source

All Articles