在某些情况下,UITableView didSelectRowAtIndexPath
会被调用两次,从而导致错误Pushing the same view controller instance more than once is not supported
。
以下是事件的顺序:
TableView::didSelectRowAtIndexPath.
TableView::viewWillDisappear.
PushedViewController::viewWillAppear.
TableView::didSelectRowAtIndexPath.
Error: Pushing the same view controller instance more than once is not supported'
唯一值得注意的是,UITableView异步加载图像,但它从不调用didSelectRowAtIndexPath
。此外,还重用了PushedViewController,以避免每次在UITableView中选择一个单元时都必须重新加载它。
有人知道这可能是什么原因吗?谢谢。
发布于 2017-10-25 21:25:02
如果你已经创建了Storyboard Segue,不要调用;
[self performSegueWithIdentifier:@"TYPE" sender:self];
在这种方法中;
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
https://stackoverflow.com/questions/5687991
复制相似问题