Hi I have arrays saved in NSUserDefaults in my ios application. I want to create a two way sync to get data from the sql server and store it in this database as well as updating the server with this database. How would i do th开发者_如何学Pythonis?
Can you explain a little better. I think I understand what you are trying to do.
First, you will need to create a server side page that will display the data you want to store on the iPhone in NSUserDefaults
. I would recommend having the page display the data output in json format, then use a JSON Parser library like SBJSON to parse the data into an NSArray
then you store this information in NSUserDefaults. To get this data you can use an NSURLConnection
.
To send data to the server it's much of the same thing you will need to use NSURLConnection
to send the data back to the server either via POST or GET methods.
精彩评论