How to sync the data with web server once device came into network? [closed]
Want to improve this question? Update the question so it focuses on one problem only by editi开发者_如何转开发ng this post.
Closed 4 years ago.
Improve this questionIn my app which is data collection app i need offline support. Let's say when i am gathering user's data there is no connection on device but once the device comes in network the whole data should automatically goes to the server. How should i implement this kind of functionality.
Thanks,
Your question is pretty vague, but I assume you're wondering HOW to persist data and not how to automatically send it to the server.
If the data is very simple, NSUserDefaults may suffice.
If you need a bit more complicated data structures, you can use archives.
If you need to store complex object graphs you need to use Core Data.
There's a pretty good guide explaining all of these here.
精彩评论