【发布时间】:2014-07-17 20:43:58
【问题描述】:
我的ViewController 中有一个UIWebView,我想在UIApplicationDelegate 传递一个URL 时更新它,例如
myApp://?changeWebView=newstuff
我正在根据传入的数据构建新的 URL,但我不知道如何更新我的 UIWebView
我的AppDelegate.m 中有这个:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
NSLog(@"Calling Application Bundle ID: %@", sourceApplication);
NSLog(@"URL scheme:%@", [url scheme]);
NSLog(@"URL query: %@", [url query]);
NSLog(@"URL hash: %@", [url fragment]);
NSURL *newURL = [NSURL URLWithString:@"URL constructed with pieces of passed URL data"];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:newURL];
//now I want to update the UIWebview defined in my ViewController.h
return YES;
}
【问题讨论】:
标签: ios uiwebview appdelegate uiapplicationdelegate uiwebviewdelegate