我只使用-reloadData來重新加載我的表,但由於某種原因它每次加載這個表時崩潰。這僅僅是在應用程序中很多表都是由同一個視圖 - 控制器超處理中的一種:與桌面視圖重新加載有關的奇怪崩潰
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x321effbc objc_msgSend + 16
1 UIKit 0x31abd9c4 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 540
2 UIKit 0x31abcaa2 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1070
3 UIKit 0x31abc22c -[UITableView layoutSubviews] + 200
4 UIKit 0x31a60d44 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 176
5 CoreFoundation 0x36de4224 -[NSObject performSelector:withObject:] + 36
6 QuartzCore 0x317ab37a -[CALayer layoutSublayers] + 210
7 QuartzCore 0x317aaf92 CA::Layer::layout_if_needed(CA::Transaction*) + 210
8 QuartzCore 0x317af114 CA::Context::commit_transaction(CA::Transaction*) + 220
9 QuartzCore 0x317aee50 CA::Transaction::commit() + 308
10 QuartzCore 0x317a6d7e CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 50
11 CoreFoundation 0x36e59b44 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 12
12 CoreFoundation 0x36e57d80 __CFRunLoopDoObservers + 252
13 CoreFoundation 0x36e580da __CFRunLoopRun + 754
14 CoreFoundation 0x36ddb4d6 CFRunLoopRunSpecific + 294
15 CoreFoundation 0x36ddb39e CFRunLoopRunInMode + 98
16 GraphicsServices 0x32ab6fe6 GSEventRunModal + 150
17 UIKit 0x31a8b73c UIApplicationMain + 1084
的堆棧跟蹤的步驟都不是我們直接的代碼,所以我迷路了。爲什麼會在這裏崩潰?
你什麼時候重新加載表?例如,在viewWillAppear或一些數據下載後等。 –
我重新加載在-viewDidLoad,然後當我收到「fetchedResultsControllerDidChangeContent」通知。 –
嘗試設置NSZombieEnabled YES並查看您是否嘗試訪問發佈的對象。這可能與重新加載tableview數據無關。嘗試訪問發佈的對象會再現類似的問題。 – 0x8badf00d