AlsonToh-SG
AlsonToh-SG

Reputation: 145

how to change url of uiwebview when button is clicked?

hi i guess this is pretty simple and hope it will be answered in a easy manner!

how do i change the url of the uiwebview when a button is touched up inside?

meaning to say i will have a single web view and everytime a button is clicked the URL of the webview

changes and a new page is reloaded

thanks

Upvotes: 3

Views: 5135

Answers (1)

Stephen Darlington
Stephen Darlington

Reputation: 52565

As you suggest, it's very easy:

-(void)buttonPressed:(id)sender {
  [webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://website.com/"]]];
}

This is all very well documented.

Upvotes: 4

Related Questions