[_NSConcreteObservation center]: нераспознанный селектор отправлен в класс 'Получение случайных ошибок, подобных этой, при обновлении моего collectionView?
На самом деле я создаю менеджер загрузок для разных категорий. И я застрял здесь. Я получаю эти ошибки в этой строке
self.videoListCollectionView.setCollectionViewLayout (flowLayout, animated: false)
func layoutCollectionView () {
if categoryFilter == "video" {
self.getData()
self.videoListCollectionView.collectionViewLayout.invalidateLayout()
self.videoListCollectionView.register(UINib.init(nibName: "MessageItemCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "Cell_Identifier")
let flowLayout = UICollectionViewFlowLayout.init()
flowLayout.scrollDirection = .vertical
flowLayout.itemSize = CGSize(width: UIScreen.main.bounds.size.width-10, height: 220)
flowLayout.minimumLineSpacing = 10
self.videoListCollectionView.setCollectionViewLayout(flowLayout, animated: false)
//self.videoListCollectionView.collectionViewLayout = flowLayout
self.videoListCollectionView.dataSource = self
self.videoListCollectionView.delegate = self
self.videoListCollectionView.reloadData()
}else if categoryFilter == "audio"{
self.getData()
self.videoListCollectionView.collectionViewLayout.invalidateLayout()
self.videoListCollectionView.register(UINib.init(nibName: "DownloadCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "Cell_Identifier1")
let flowLayout1 = UICollectionViewFlowLayout.init()
flowLayout1.scrollDirection = .vertical
flowLayout1.itemSize = CGSize(width: UIScreen.main.bounds.size.width-10, height: 80)
flowLayout1.minimumLineSpacing = 10
self.videoListCollectionView.setCollectionViewLayout(flowLayout1, animated: false)
//self.videoListCollectionView.collectionViewLayout = flowLayout1
self.videoListCollectionView.dataSource = self
self.videoListCollectionView.delegate = self
self.videoListCollectionView.reloadData()
}else if categoryFilter == "notes"{
//self.getData()
self.videoListCollectionView.collectionViewLayout.invalidateLayout()
self.videoListCollectionView.register(UINib.init(nibName: "DownloadNoteCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "Cell_Identifier2")
let flowLayout2 = UICollectionViewFlowLayout.init()
flowLayout2.scrollDirection = .vertical
flowLayout2.itemSize = CGSize(width: UIScreen.main.bounds.size.width-10, height: 80)
flowLayout2.minimumLineSpacing = 10
self.videoListCollectionView.setCollectionViewLayout(flowLayout2, animated: false)
//self.videoListCollectionView.collectionViewLayout = flowLayout1
self.videoListCollectionView.dataSource = self
self.videoListCollectionView.delegate = self
self.videoListCollectionView.reloadData()
}
2018-01-09 17: 26: 44.024 LCM-iOSApp [16990: 626500] + [_ NSConcreteObservation center]: нераспознанный селектор отправлен в класс 0x10b66b038 2018-01-09 17:26:44.048 LCM-iOSApp[16990:626500]
Завершение работы приложения из-за невыполненной исключительной ситуации NSInvalidArgumentException, причина: '+[_NSConcreteObservation center]: нераспознанный селектор, отправленный в класс 0x10b66b038' *** Стек первого вызова вызова:
0 CoreFoundation 0x000000010c1b8b0b exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010b808141 objc_exception_throw + 48
2 CoreFoundation 0x000000010c228074 +[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010c13f840 ___forwarding___ + 1024
4 CoreFoundation 0x000000010c13f3b8 _CF_forwarding_prep_0 + 120
5 UIKit 0x000000010e45b3c4 -[UICollectionView _setCollectionViewLayout:animated:isInteractive:completion:animator:] + 1732
6 UIKit 0x000000010e45ace9 -[UICollectionView _setCollectionViewLayout:animated:isInteractive:completion:] + 76
7 UIKit 0x000000010e45aa46 -[UICollectionView setCollectionViewLayout:animated:] + 429
8 LCM-iOSApp 0x0000000109ced2a8 _TFC10LCM_iOSApp23DownloadsViewController20layoutCollectionViewfT_T_ + 5336
9 LCM-iOSApp 0x0000000109ce1e1d _TFFC10LCM_iOSApp23DownloadsViewController21MessagesListingFilterFP_T_U1_FT_T_ + 1693
10 LCM-iOSApp 0x0000000109968d17 _TTRXFo___XFdCb___ + 39
11 libdispatch.dylib 0x000000010fe094a6 _dispatch_call_block_and_release + 12
12 libdispatch.dylib 0x000000010fe3205c _dispatch_client_callout + 8
13 libdispatch.dylib 0x000000010fe1340b _dispatch_main_queue_callback_4CF + 411
14 CoreFoundation 0x000000010c17d909 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
15 CoreFoundation 0x000000010c143ae4 __CFRunLoopRun + 2164
16 CoreFoundation 0x000000010c143016 CFRunLoopRunSpecific + 406
17 GraphicsServices 0x00000001141c9a24 GSEventRunModal + 62
18 UIKit 0x000000010db1d134 UIApplicationMain + 159
19 LCM-iOSApp 0x0000000109c78f87 main + 55
20 libdyld.dylib 0x000000010fe7e65d start
libC++abi.dylib: завершается с необработанным исключением типа NSException (lldb)