I’m new to iPhone development, I need help.
I want to download an XML file from a server and store it locally.
When I open my app first the time alone, it should show the network status.
Once the network is connected it should grab the XML file from the server and store it locally.
When the network is offline, my app should use the last saved XML file.
You are looking for too much here, your question is too broad. Here are some starting points for you:
Have a look at Seismic XML, official Apple example on how to download XML data from server. Once your file is downloaded, you can save it either:
1) In a database
2) Using CoreData
3) Write entire XML file directly to disk
It depends on your needs really.
On next application start, you need to check if connection is available. You can see how it is done in Reachability Apple example. If connection is available, download new file from server. If not, load the previously saved one.