Skip to content

Instantly share code, notes, and snippets.

@bartolsthoorn
Created July 8, 2011 11:18
Show Gist options
  • Save bartolsthoorn/1071624 to your computer and use it in GitHub Desktop.
Save bartolsthoorn/1071624 to your computer and use it in GitHub Desktop.
Is it possible to change the url of one webview later in another function by using the specified tag?
for( int i = 0; i < 4; i++ ) {
UIWebView *wview;
int wx;
if (i < 2) {
wx = 12;
} else {
wx = 512;
}
wview = [[UIWebView alloc] initWithFrame:CGRectMake(wx, 16, 500, 716)];
[wview setTag:i];
NSLog(@"Set webview to: %@", xpath);
NSURL *xurl = [NSURL fileURLWithPath:xpath isDirectory:NO];
NSURLRequest *request=[NSURLRequest requestWithURL:xurl];
[wview loadRequest:request];
//set the web view delegates for the web view to be itself
[wview setDelegate:self];
[self.view addSubview:wview];
[wview release];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment