0

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 ?

4
  • This question is too vague. How does the server present the data? XML, JSON, what?
    – trojanfoe
    Commented May 14, 2013 at 10:27
  • List Of Question in two lines. 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 ?
    – Buntylm
    Commented May 14, 2013 at 10:27
  • can you share it ? I don't know how server and sqlite connect each other !
    – malinchhan
    Commented May 14, 2013 at 10:32
  • I use php in server side !
    – malinchhan
    Commented May 14, 2013 at 10:33

1 Answer 1

1

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 :)

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.