讓我首先說這不是關於設置重用標識符的問題。問題是,儘管在故事板中設置了重複使用標識符(儘管使用register(cellClass:forCellReuseIdentifier:)
手動註冊它),但我仍然收到以下錯誤。無法使標識符出廠單元格
*** Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason:
'unable to dequeue a cell with identifier TCAccountGroups - must register a
nib or a class for the identifier or connect a prototype cell in a storyboard'
我同時使用搜索欄控制器和NSFetchedResultsController做一個搜索表,用戶可以將現有的選項,或任何用戶定義的選項之間進行選擇。
任何建議將不勝感激。如果我錯過了任何有用的信息,我將非常樂意提供。
編輯:我忘了提及我在Mac OS Sierra 10.12.1上使用Swift 3.0.1和XCode 8.0.1。
編輯2:在Xcode中第二個到最後消息是:
*** Assertion failure in -[UISearchResultsTableView
dequeueReusableCellWithIdentifier:forIndexPath:],
/BuildRoot/Library/Caches/com.apple.xbs
/Sources/UIKit_Sim/UIKit-3600.5.2/UITableView.m:6593
所以也許有在UISearchResultsTableView
類的錯誤嗎?
編輯3:這裏是我的連接屏幕截圖:
https://i.stack.imgur.com/7Y8TA.png
https://i.stack.imgur.com/M7IU2.png
https://i.stack.imgur.com/VAaeF.png
https://i.stack.imgur.com/EJLvp.png
我對鏈接的歉意,但SO不讓我保存圖像內聯。
請編輯您的問題,包括完整的方法,你在哪裏調用'寄存器(cellClass:forCellReuseIdentifier:)'。 –
我在'viewDidLoad'中調用它,我使用的完整方法是'register(UITableViewCell.self,forCellReuseIdentifier:「TCAccountGroups」)'。 – dohpaz42
您是否爲您的tableViewCell設置了標識符TCAccountGroups? – nynohu