tags:

views:

135

answers:

3

hello all,

Is there any tutorial or blog or some documents which helps in learning how to communicate server from my iPhone application.

I just want to do a simple thing. Which is a page update.

Like I have a Label which needs to update to one particular name stored in my database and this database resides on a server.

So how to do this.

A: 

In the apple docs look at NSURLRequest/NSURLMutableRequest here http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSURLRequest_Class/Reference/Reference.html, this is the object you want to work with to achieve what you want. Youll set is URL, its connection properties, its httpMethod etc.

Daniel
A: 

Your question has many answers and they all depend upon how you implement your server side. The path of least resistance is probably to create a web service that runs on top of a web server such as Apache. If you don't have the server side implemented as a web service, though, you could even create a web form and have the iPhone app create a POST request using NSMutableURLRequest that posts data to your form.

What have you done on the server side so far?

Matt Long
A: 

If you only need to display one value then you could do something very simple like:

[myLabel setText:[NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.mywebsite.com/PageThatReturnsWhatYouWant"]]];
Lounges