0

I will admit, I don't know much about PHP and have google'd around for an answer but haven't had much luck in finding anything to suit my needs. I have however managed to create a simple connection script and login/authentication script to my server for my iOS app. I have a table in the MySQL database which holds a list of events and was wondering what would be the best way to populate cells using the values from this table.

I already have the UITableView set up, and have managed to get it loading data from a local array all to the right places on the custom cell.

I am able to @echo the results of all of the table back, but what would be the best way to go about populating each cell with one row of the table?

Thanks!

1 Answer 1

1

It's good idea to use JSON to transfer data. PHP should have JSON support as well.

This is library for iPhone: https://github.com/stig/json-framework/

You need:

  1. Using PHP get data from the database
  2. Produce JSON-encoded array in PHP script
  3. Read this data using NSURLConnection on iOS device
  4. Parse received data from JSON to Obj-C objects (using the library above)

This is not so easy to learn fast, but there is a lot of examples in the Internet and this is good practice for sure. Learned once - helps forever.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I have JSON, I'll try and find some tutorials and see where I can get to. Thanks.

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.