我有一个三个标签控制栏。每个人都将使用webview。我正在尝试将标签1的webview中的链接推送到标签2的webview中。我花了大约12个小时才完成这个问题,但仍然遇到了同样的问题。我终于确定我需要这样的东西:
UINavigationController *navigationController = [self.tabBarController.viewControllers objectAtIndex:1];
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
ClientViewController *vc = [sb instantiateViewControllerWithIdentifier:@"ClientView"];
[vc setTempUrl:self.urlstring];
[navigationController pushViewController:vc animated:YES];
我在这里缺少什么?在输出中,我不断收到“无法识别的选择器到实例。”
ClientViewController.m(我认为这就是你需要的所有内容吗?)
NSString *str = tempUrl;
NSURL *url = [NSURL URLWithString:str];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[_webView loadRequest:request];
ClientViewController.h
@interface ClientViewController : UIViewController{
NSString *myUrl;
NSString *tempUrl;
}
@property (weak, nonatomic) IBOutlet UIWebView *webView;
@property (retain, nonatomic) NSString *myUrl;
@property (retain, nonatomic) NSString *tempUrl;
所有输出日志:
[ClientViewController pushViewController:animated:]:无法识别的选择器发送到实例0x20874980 2013-04-11 12:31:35.599 Access Portal [2785:907] * WebKit在webView中丢弃了未捕获的异常:decisionPolicyForNavigationAction:request:frame:decisionListener:delegate: - [ClientViewController pushViewController:animated :]:无法识别的选择器发送到实例0x20874980
答案 0 :(得分:0)