Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 已将无法识别的选择器发送到实例uitableview_Iphone - Fatal编程技术网

Iphone 已将无法识别的选择器发送到实例uitableview

Iphone 已将无法识别的选择器发送到实例uitableview,iphone,Iphone,我收到错误:无法识别的选择器被发送到实例,经过检查,我发现这段代码中存在问题,更具体地说:[self.tableView insertSubview:ovController.view oversubview:self.parentview controller.view] - (void) searchBarTextDidBeginEditing:(UISearchBar *)theSearchBar { if(searching) return; //Add the overl

我收到错误:无法识别的选择器被发送到实例,经过检查,我发现这段代码中存在问题,更具体地说:
[self.tableView insertSubview:ovController.view oversubview:self.parentview controller.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;

 }

tableview似乎有问题?

我不确定为什么这会导致无法识别的选择器异常,但很可能[self.tableview insertSubview:ovController.view oversubview:self.parentview controller.view];可能是对的。仅当self.parentViewController.view是self.tableView的子视图时,此操作才有效。除非你对视图层次结构做了非常有害的事情,否则这看起来像是自上而下的。

你确定你要使用
self.parentViewController.view
而不是
[self.view superview]
?早上这个时候我很累-。-,修正了self.viewsuperview:)谢谢,让我们模拟一下:菜单(根控制器)->项(二级控制器)。现在你这么说,这是有道理的。