我将自定义的UITableViewController按如下方式嵌入其它ViewController:
MessageListViewController * messageView = [[MessageListViewController alloc] init];
messageView.view.frame = CGRectMake(0, 0, self.view.frame.size.width, 300);
[self.view addSubview:messageView.view];
结果出现objc_msgSend报错,console提示如下:
*** -[MessageListViewController numberOfSectionsInTableView:]: message sent to deallocated instance 0xa847090
self.messageView = [[MessageListViewController alloc] init];
self.messageView.view.frame = CGRectMake(0, 0, self.view.frame.size.width, 300);
[self.view addSubview:self.messageView.view];
浪费了很长时间,特此记录,希望对大家有帮助。