Reputation: 11605
I'm getting error: Unrecognised selector sent to instance, upon inspection, I see there is an issue in this section of code, and more specifically: [self.tableView insertSubview:ovController.view aboveSubview:self.parentViewController.view];
- (void) searchBarTextDidBeginEditing:(UISearchBar *)theSearchBar {
if(searching)
return;
//Add the overlay view.
ovController = [[OverlayViewController alloc] initWithNibName:@"OverlayView" bundle:[NSBundle mainBundle]];
CGFloat yaxis = self.navigationController.navigationBar.frame.size.height;
CGFloat width = self.view.frame.size.width;
CGFloat height = self.view.frame.size.height;
//Parameters x = origion on x-axis, y = origon on y-axis.
CGRect frame = CGRectMake(0, yaxis, width, height);
ovController.view.frame = frame;
ovController.view.backgroundColor = [UIColor grayColor];
ovController.view.alpha = 0.5;
ovController.rvController = self;
[self.tableView insertSubview:ovController.view aboveSubview:self.parentViewController.view];
searching = YES;
letUserSelectRow = NO;
//self.tableView.scrollEnabled = NO;
}
Looks like there's an issue with tableview?
Upvotes: 0
Views: 349
Reputation: 17918
I'm not sure why this would result in an unrecognized selector exception but it seems highly unlikely that [self.tableView insertSubview:ovController.view aboveSubview:self.parentViewController.view]; could possibly be correct. This would only work if self.parentViewController.view is a subview of self.tableView. That seems inside-out unless you're doing very abusive things to your view hierarchy.
Upvotes: 2