Now I have a server with many tables. In xcode, I use sqlite to store data from 1 table of server, so what should I do to connect and get data from server to store in slite db ?
1 Answer
You should have server side scripts ready for web services either REST
or SOAP
webservices.
Then, all you'll need to do in your iPhone app is use an NSURLConnection
to fetch the URL. NSURLConnection
is a very nice, asynchronous
way of downloading files from remote locations.
After that, it's a simple matter of parsing the XML
or JSON
you can do that by using NSXMLParser
http://wiki.cs.unh.edu/wiki/index.php/Parsing_XML_data_with_NSXMLParser
NSJSONSerialization
http://www.raywenderlich.com/5492/working-with-json-in-ios-5
or third party api's
Once you have sorted out the required data you can save it in sqlite
db in your device
This link should get you some idea about sqlite
http://www.raywenderlich.com/913/sqlite-101-for-iphone-developers-making-our-app
Hope it helps :)
1.
Create Xml/Json/WebService on Server ?2.
Read data through Xml/Json/WebService on client side and create Bean Class ?3.
Create Database/Table with Sqlite on client side ?4.
Use Insert Query and add data in tables.5.
Use Select Query and populate data in App.Note
Are you looking for source code ?