1

didSelectRowAtIndexPath: UITableView のデリゲート メソッドで NEOfficesRootViewController から NEOfficesDetailViewController をプッシュしようとしています。この UITableView には NSFecterResultsController がアタッチされています。

一般的な状況ではすべてが正常に機能し ます、NSFetcherResultsController のコンテキストが変化している間にテーブルの行を複数回タップすると (単一のコンテキスト、メインスレッドですべての変更)、 didSelectRowAtIndexPath: メソッドが複数回呼び出され、ネストされた結果になりますプッシュアニメーション。

また、私は奇妙なことに言及しました: didSelectRowAtIndexPath: は、すべてのコンテキスト計算が終了した後に複数回呼び出されます。UITableView がタップをキューに保存し、(メインスレッドが解放されると) それらを解放するようです。したがって、計算中にテーブル ビューの行を 4 回タップすると、すべての計算の後に didSelectRowAtIndexPath: メソッドが 4 回呼び出されます。これが私のデバッグリストです:

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

3 に答える 3

1

データのフェッチ中にユーザーの操作をブロックします。

フェッチを開始する前に、インタラクションをブロックするビューを作成し、フェッチが終了したら、ブロックしているビューを削除します。

MBProgressHUDはこれに適しています。

于 2013-01-04T15:10:47.467 に答える
0

[tableView setDelaysContentTouches:NO]; が正解です...

于 2013-02-20T11:52:23.780 に答える
0

サブビューでカバーするか、userInteraction を直接変更して UI をブロックしても、何も起こりません。setDelaysContentTouches:NO UITableView のメソッドを使用すると、問題が解決しました。

@Jeffery、ご協力ありがとうございます。

于 2013-01-04T16:07:04.947 に答える