0
votes

I am trying to pass a link to a custom controller, (GMWebView, a subclass of UIViewController with a UIWebView in it) and I get this error:

2013-03-05 20:34:37.930 viei_A6[3233:c07] -[UIViewController setLink:]: unrecognized selector sent to instance 0x71b91d0 2013-03-05 20:34:37.931 viei_A6[3233:c07] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController setLink:]: unrecognized selector sent to instance 0x71b91d0'

My program uses a segue to move into GMWebView, and I am setting the link for the UIWebView object.

- (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];
    }
}

And here is setLink:

- (void)setLink:(NSString *)newLink
{
    NSLog(@"testing for crash");
    if (link != newLink) {
        link = newLink;
        // Update the view.
        [self configureView];
    } 
}

Any help would be nice, it is the only thing holding me back from finishing my app at the moment

1

1 Answers

1
votes

Check the class of this view controller on the storyboard. It looks like the actual class is UIViewController. You want to change it to GMWebView