我正在尝试从didSelectRowAtIndexPath中的NEOfficesRootViewController推送NEOfficesDetailViewController:UITableView的委托方法。这个UITableView附有NSFectherResultsController。
在一般情况下一切正常, 但如果我在NSFetcherResultsController的上下文发生变化时多次在表行上点击(单个上下文,主线程上的所有更改),didSelectRowAtIndexPath:方法将被多次调用,这将导致嵌套推送动画。
另外我提到了一个奇怪的事情:didSelectRowAtIndexPath:在所有上下文计算完成后多次调用,看起来UITableView将我的抽头保存在队列中然后(当主线程变为空闲时)释放它们。 因此,如果我在计算过程中在表视图的行上点击4次,则在所有计算之后将调用4次选择RowAowIndexPath:方法。 这是我的调试清单:
2013-01-04 16:41:14.038 nightexpress[858:707] connection created: YES
2013-01-04 16:41:14.414 nightexpress[858:707] NEOfficesRootViewController: viewDidAppear: called
2013-01-04 16:41:16.625 nightexpress[858:707] connection received response: 200 no error
2013-01-04 16:41:16.632 nightexpress[858:707] connection finish loading. data
2013-01-04 16:41:17.445 nightexpress[858:707] started deleting sequence
2013-01-04 16:41:17.460 nightexpress[858:707] finished deleting sequence
2013-01-04 16:41:17.463 nightexpress[858:707] starting saving sequence
2013-01-04 16:41:17.585 nightexpress[858:707] contextWillSave: called
2013-01-04 16:41:18.763 nightexpress[858:707] contextDidSave: called
2013-01-04 16:41:18.782 nightexpress[858:707] finished saving sequence
2013-01-04 16:41:18.784 nightexpress[858:707] officesUpdateSentAndReceivedResponse: called
2013-01-04 16:41:18.796 nightexpress[858:707] updateFetchingLocationUI called
2013-01-04 16:41:19.220 nightexpress[858:707] NEOfficesRootViewController: tableView: didSelectRowAtIndexPath: 0 0
2013-01-04 16:41:19.261 nightexpress[858:707] NEOfficesDetailViewController: viewDidLoad: called
2013-01-04 16:41:19.266 nightexpress[858:707] NEOfficesDetailViewController: initializing scrollView content
2013-01-04 16:41:19.276 nightexpress[858:707] NEOfficesDetailViewController: updateFetchingLocationUI called
2013-01-04 16:41:19.279 nightexpress[858:707] NEOfficesDetailViewController: configureAndInstallAnotations called. initial annotation count: 0
2013-01-04 16:41:19.288 nightexpress[858:707] NEOfficesRootViewController: viewWillDisappear: called
2013-01-04 16:41:19.290 nightexpress[858:707] NEOfficesDetailViewController: viewWillAppear: called
2013-01-04 16:41:19.301 nightexpress[858:707] NEOfficesRootViewController: tableView: didSelectRowAtIndexPath: 0 1
2013-01-04 16:41:19.303 nightexpress[858:707] nested push animation can result in corrupted navigation bar
2013-01-04 16:41:19.310 nightexpress[858:707] NEOfficesRootViewController: tableView: didSelectRowAtIndexPath: 0 3
2013-01-04 16:41:19.313 nightexpress[858:707] nested push animation can result in corrupted navigation bar
2013-01-04 16:41:19.319 nightexpress[858:707] NEOfficesRootViewController: tableView: didSelectRowAtIndexPath: 0 6
2013-01-04 16:41:19.321 nightexpress[858:707] nested push animation can result in corrupted navigation bar
2013-01-04 16:41:19.328 nightexpress[858:707] NEOfficesRootViewController: tableView: didSelectRowAtIndexPath: 0 4
2013-01-04 16:41:19.330 nightexpress[858:707] nested push animation can result in corrupted navigation bar
2013-01-04 16:41:19.335 nightexpress[858:707] NEOfficesRootViewController: tableView: didSelectRowAtIndexPath: 0 3
2013-01-04 16:41:19.458 nightexpress[858:707] nested push animation can result in corrupted navigation bar
2013-01-04 16:41:19.469 nightexpress[858:707] NEOfficesRootViewController: tableView: didSelectRowAtIndexPath: 0 1
2013-01-04 16:41:19.470 nightexpress[858:707] nested push animation can result in corrupted navigation bar
2013-01-04 16:41:19.478 nightexpress[858:707] NEOfficesRootViewController: tableView: didSelectRowAtIndexPath: 0 3
2013-01-04 16:41:19.479 nightexpress[858:707] nested push animation can result in corrupted navigation bar
2013-01-04 16:41:19.486 nightexpress[858:707] NEOfficesRootViewController: tableView: didSelectRowAtIndexPath: 0 6
2013-01-04 16:41:19.488 nightexpress[858:707] nested push animation can result in corrupted navigation bar
2013-01-04 16:41:19.499 nightexpress[858:707] NEOfficesRootViewController: tableView: didSelectRowAtIndexPath: 0 7
2013-01-04 16:41:19.501 nightexpress[858:707] nested push animation can result in corrupted navigation bar
2013-01-04 16:41:19.978 nightexpress[858:707] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-01-04 16:41:19.982 nightexpress[858:707] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-01-04 16:41:19.984 nightexpress[858:707] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-01-04 16:41:19.985 nightexpress[858:707] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-01-04 16:41:19.993 nightexpress[858:707] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-01-04 16:41:19.995 nightexpress[858:707] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-01-04 16:41:19.997 nightexpress[858:707] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-01-04 16:41:20.000 nightexpress[858:707] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-01-04 16:41:20.002 nightexpress[858:707] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2013-01-04 16:41:20.012 nightexpress[858:707] Unbalanced calls to begin/end appearance transitions for <NEOfficesDetailViewController: 0x100fba70>.
答案 0 :(得分:1)
答案 1 :(得分:0)
通过用子视图覆盖UI或直接更改userInteraction来阻止UI将不会产生任何结果。 使用setDelaysContentTouches:NO UITableView的方法为我解决了这个问题。
@Jeffery,谢谢你的帮助。
答案 2 :(得分:0)
[tableView setDelaysContentTouches:NO];是正确答案......