[英]Unknown class in interface builder file yet class exists
之前曾問過這個問題,但是我看不到任何與我的問題有關的原因。
我創建了一個非常簡單的視圖控制器,嘗試加載它,但是在界面生成器文件錯誤中得到了未知類MapViewController。 以下是一些相關的部分:
class MapViewController: UIViewController {
...
}
...
let storyboard : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let mapViewController = storyboard.instantiateViewControllerWithIdentifier("MapViewControllerID") as MapViewController
問題仍然存在,有什么建議嗎?
(使用Xcode beta 4)
我的問題是我不小心在IB的自定義類的類條目下選擇了一個模塊。 取消選擇后,一切正常。
我的解決方法是1)刪除派生數據2)將類重命名為MyMapViewController 3)再次刪除派生數據4)將類重命名回MapViewController
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.