views:

25

answers:

1

Hi,

I am new to iphone dev. I have a Label and a scroll view. I am trying to get data from url and bind it to label and a scroll view. I am able to bind the data to label by using...

UrlValues *asana=[[data yoga]objectAtIndex:i];
self.AsanaName.text = [asana asanatitle];

Similarly i want to bind some other data in the url to a scroll view. The data i want to bind is 4 or 5 sentences. So, can anyone help me how to do it... Any sample code will be really helpful... Thanks

A: 

if you want to show text from the URL fetch text from URL -

NSString *data_from_URL = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"urlgoes here"] encoding:NSUTF8StringEncoding error:nil];

Then you can set this text in the UITextView -

UITextView *sv = [[UITextView alloc] init];
[sv setText:data_from_URL];
Saurabh
The data is json data... Not simple text from url... I have binded json text to the label. Now i want to know how to bind the json data from another child to the scroll view...
Rahul Varma