gpt4 book ai didi

iphone - didSelectRowAtIndexPath : nested push animations

转载 作者:行者123 更新时间:2023-11-29 13:21:59 25 4
gpt4 key购买 nike

我试图在 didSelectRowAtIndexPath: UITableView 的委托(delegate)方法中从 NEOfficesRootViewController 推送 NEOfficesDetailViewController。这个 UITableView 附加了 NSFectherResultsController。

在一般情况下一切正常,但是 如果我在 NSFetcherResultsController 的上下文发生变化时多次点击表格的行(单个上下文,主线程上的所有更改),didSelectRowAtIndexPath: 方法将被多次调用,这将导致嵌套推送动画。

我还提到了一件奇怪的事情:didSelectRowAtIndexPath: 在所有上下文计算完成后被多次调用,似乎 UITableView 将我的点击保存在队列中,然后(当主线程空闲时)释放它们。因此,如果我在计算期间在 TableView 的行上点击 4 次,didSelectRowAtIndexPath: 方法将在所有计算之后被调用 4 次。这是我的调试 list :

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>.

最佳答案

在获取数据时阻止用户交互。

在您开始获取之前放置一个阻止交互的 View ,当获取完成时移除阻止的 View 。

MBProgressHUD对此有好处。

关于iphone - didSelectRowAtIndexPath : nested push animations,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14159462/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com