這是它在哪裏崩潰CollectionView.ReloadItemsForIndexPaths崩潰迅速
for var i=0;i<Data.NearByList.count;i++ {
if let collectionView = collview {
collectionView.reloadItemsAtIndexPaths([NSIndexPath(forItem: i, inSection: 0)])
}
}
我想在viewdidApear重裝的CollectionView數據,因爲一些圖像顯示不正確 但總是收到此錯誤
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSStackBlock__ _setNeedsFocusItemOverlayUpdate]: unrecognized selector sent to instance 0x45426c' *** First throw call stack: (0x2799386b 0x39092dff 0x27999035 0x27996c8f 0x278c62b8 0x2c2387d3 0x2c238379 0x2bb09dc3 0x2c241e7b 0x2bc82b45 0x2c2435fd 0x2bab3abd 0x2c242e25 0x2c2413fd 0x2bc7ea1d 0x1efe9c 0x2029e4 0x28694b8b 0x27947ffd 0x27947a0b 0x279477e1 0x2799bac3 0x278a904b 0x28692317 0x28696e4b 0x1fe0ec 0x117a6c 0xfe684 0x117bfc 0x27218a25 0x28750a05 0x286b24af 0x286a48bf 0x28752cc5 0x14bbdab 0x14c0829 0x27956595 0x27954a8f 0x278a71e9 0x278a6fdd 0x30b4baf9 0x2bb0c18d 0x1f51a8 0x397bd873) libc++abi.dylib: terminating with uncaught exception of type NSException
有人可以找到這個解決方案
爲什麼不只是調用collectionView.reloadData() ?爲什麼這個迭代需要? – dirtydanee
它重新加載了一些單元格,並且一些圖像仍然不正確 –
比您的數據源未刷新,我認爲。你應該照顧,而不是黑客collectionView, – dirtydanee