CodeMoto
CodeMoto

Reputation: 353

iOS Loading Data From A Web Server - Best Practices?

I've been working on my first iOS app and I finally have something that works like I intended. This app reads in an XML file, parses that data and displays what needs to be listed - a list of profiles actually. What I want to do know is have the app check a web service (I'll code this in PHP) and retrieve this XML file.

So my question are: What is the best practice for handling this? Should I keep my data in an XML file or use something else (JSON I think)? What are the standard approaches a more experience developer would take?

What I envision is there's a web site that a user can enter their information in, which then stores their profile information in a database. Then the web service simply pulls this data and provides it to the phone.

Upvotes: 1

Views: 1296

Answers (1)

Midhun MP
Midhun MP

Reputation: 107121

Whether it is json or xml, never retrieve data on main thread. It'll make your app's UI unresponsive.

Her is two tutorials which will help you alot.

  1. JSON
  2. XML

Upvotes: 1

Related Questions