簡體   English   中英

XCode 6.3 Init()不再編譯

[英]XCode 6.3 Init() No Longer Compiles

剛剛升級到XCode 6.3並解決了所有編譯錯誤,但在我的許多類中都出現過。

我在示例類中執行以下操作:

init()
{
    super.init()

    let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
    managedContext = appDelegate.managedObjectContext!
}

這將在super.init()調用上返回以下錯誤:

Must call a designated initializer of the superclass 'UITableViewController'

有人看到這個或想出解決辦法了嗎?

您必須使用UITableViewController的指定初始化程序,即

init(style style: UITableViewStyle)

例如:

super.init(style: .Plain)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM