Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ac1

macrumors newbie
Original poster
Jan 17, 2011
7
0
First post, hi!

I am looking to create a 'simple' iphone app that shows the location of updates from nearby users. A user can insert an update (along with location, which I can get as a longitude,latitude) and then this is updated to some database online and the latest x updates are downloaded and put on a map as pins (which again I can do using MKAnnotations)... question is how would I upload and download data to the database.

TIA.
 
Last edited:
I've created a mySQL database and the PHP to go with it which allows me to insert data into the table.

Now, I'm thinking I could just use NSURLRequest to upload "http://site.com/database/upload.php?lat=%@&long=%@&update=%@"

problem is I can't quite see how exactly I'd get this to work.

I haven't started thinking about downloading the data back to the app, but I suppose I could write more PHP to help me.

EDIT: Fixed NSURL Request...

I'm going to output each row from the table as a JSON object, and then write a for loop over each row to place a pin on the map.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.