tags:

views:

247

answers:

1

Hi

I have a php file which when opened browser displays "hello" and nothing more

I want to grab this content so it will display "hello" on a label on the iphone

Can anyone provide a very simple way of doing this, thanks.

A: 

I think this should do it:

NSURL *url = [NSURL URLWithString:@"http://example.com/word"];
NSError *error;

myLabel.text = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];
Vincent Osinga