的UIViewController子類我有一個泛型類:的Xcode 7斯威夫特2無法實例化通用的UITableViewController
class PaginatedTableViewController
<GenericElement, Source: PaginationDataSource
where Source.PaginatedGenericElement == GenericElement>:
UITableViewController
,另一個是我嘗試從故事板實例:
class CandidatesTableViewController:
PaginatedTableViewController<Match, MatchPaginationDataSource>
我無法找到故事板自定義類下拉菜單中的CandidatesTableViewController
。如果我強制它,然後在代碼中投我的控制器,應用程序崩潰在運行時抱怨我的控制器(這應該是一個CandidatesTableViewController實例)實際上是一個UITableViewController實例。
未知類_TtC21MyProjectName29CandidatesTableViewController在 Interface Builder文件中。 無法將 'UITableViewController'(0x1040917f8)類型的值轉換爲 'MyProjectName.CandidatesTableViewController'(0x1013a9890)。
在我的項目該控制器嵌入在一個又一個,這就是爲什麼我投它:
tableViewController = (segue.destinationViewController as! CandidatesTableViewController)
是否有任何人知道如何解決這個問題?