我正在尝试将链接传递给自定义控制器(GMWebView,UIViewController 的子类,其中包含 UIWebView)并且我收到此错误:
2013-03-05 20:34:37.930 viei_A6[3233:c07] -[UIViewController setLink:]: 无法识别的选择器发送到实例 0x71b91d0 2013-03-05 20:34:37.931 viei_A6[3233:c07] *由于应用程序终止未捕获的异常“NSInvalidArgumentException”,原因:“-[UIViewController setLink:]:无法识别的选择器发送到实例 0x71b91d0”
我的程序使用 segue 移动到 GMWebView,我正在设置 UIWebView 对象的链接。
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"pushGMWeb"]) {
//NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
//NSDate *object = _objects[indexPath.row];
//[[segue destinationViewController] setDetailItem:object];
GMWebView *detailViewController = [segue destinationViewController];
NSLog(@"HERE is the link: __ %@",[[channel.items objectAtIndex:[self.tableView indexPathForSelectedRow].row] link]);
//it crashes when the following line is executed
detailViewController.link = [[channel.items objectAtIndex:[self.tableView indexPathForSelectedRow].row] link];
}
}
这是setLink:
- (void)setLink:(NSString *)newLink
{
NSLog(@"testing for crash");
if (link != newLink) {
link = newLink;
// Update the view.
[self configureView];
}
}
任何帮助都会很好,这是目前唯一让我无法完成我的应用程序的事情