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

CNuland

macrumors newbie
Original poster
Jun 17, 2010
18
0
I'm a software engineer that is rather new to programming on the IPhone platform. I'm developing an app for my office that allows communication with our web server. I've been able to find a way to download information to the server by using a NSMutableURLRequest and then using an HTTP POST to send information to a php script. However, I have not been able to come up with a solution on how to upload information from the server to the IPhone.

I tried looking into the stringByEvaluatingJavaScriptFromString command, but also ran into a dead end with that. Any help would be nice, even if it's pointing me in another direction. Thanks for the help.

Sincerely,
Chris Nuland
 
NSURLConnection to connect to a URL on the server that will send the data as an response. Simply turn the NSData (once you have it) into a NSString using the appropriate encoding.
 
Thanks guys, I'm impressed with the speedy reply :). I'll research what you both mention and see what I can find.

Thanks again for your help.

-Chris Nuland
 
If you go the NSURLConnection route (depends on how you need the data delivered and who drives the process; phone or server), I would suggest looking at Apple's SeismicXML sample project. It shows how to asynchronously download and process response data (XML in this case) from a server.

The XML aspects of this project might be helpful as well because it sounds like you may want to deploy a RESTful web service for your app to communicate with. Then, maybe read this: http://www.cimgf.com/2010/02/12/accessing-the-cloud-from-cocoa-touch/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.