I have one app in which data sync part is involved, Currently I am doing by sending data in the form of XML through NSMutableURLRequest and receving through initWithContentsOfURL.
But as the amount of data getting huge,time to sync is also increasing.
If anyone have idea how to implement this in better way,or any changes made to above implementation. So that sync time is reduced.
I wanted to know the best approach/model to follow for doing Syncing.
Currently I am Following This method..
<ROOT>
<ADD></ADD>
<UPDATE></UPDATE>
<DELETE></DELETE>
</ROOT>
I am not asking about how make connection..
In my app user can add,update & delete from iphone as well as from server means website. I want to know how to sync the data in proper way (Proper Structure of Data in Xml). so data user can see there entry on the both side. Thanks in advance...
You might want to check AFNetworking. Very easy to use and it has very good performance. You can also use the built in XML requests to send/receive XML data asynchronously and handle them as you please.
If you have any question on how to do certain things feel free to ask.
//Better and effective to use the asynchronous request to the server that will cost less time and even your UI will be remained active
NSLog(@"Server Path:%@",dataUrl);
//connection
NSURLConnection *theConnection;
NSMutableURLRequest *Request = [NSMutableURLRequest requestWithURL:dataUrl cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0];
[Request setHTTPMethod:methodName];
theConnection = [[NSURLConnection alloc] initWithRequest:Request delegate:self];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With