我有一个通用类:
class PaginatedTableViewController
<GenericElement, Source: PaginationDataSource
where Source.PaginatedGenericElement == GenericElement>:
UITableViewController
Run Code Online (Sandbox Code Playgroud)
另一个我试图从故事板中实例化:
class CandidatesTableViewController:
PaginatedTableViewController<Match, MatchPaginationDataSource>
Run Code Online (Sandbox Code Playgroud)
我CandidatesTableViewController在故事板Custom Class下拉菜单中找不到.如果我强制它然后在代码中转换我的控制器,应用程序在运行时崩溃抱怨我的控制器(应该是CandidatesTableViewController实例)实际上是一个UITableViewController实例.
Interface Builder文件中的未知类_TtC21MyProjectName29CandidatesTableViewController.无法将'UITableViewController'类型的值(0x1040917f8)转换为'MyProjectName.CandidatesTableViewController'(0x1013a9890).
在我的项目中,这个控制器嵌入另一个控制器,这就是我投射它的原因:
tableViewController = (segue.destinationViewController as! CandidatesTableViewController)
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题?