我有一個類XYZObject
從ABCObject
繼承了一些初始化和方法的初始化:在子類的其他初始化將覆蓋超類
class XYZObject: ABCObject {
var name: String = ""
init(withName name: String){
self.name = name
}
}
class ABCObject{
internal var jsonstore: JSON
init(withJson newJson: JSON){
jsonstore = newJson
}
}
但是,每當我現在請XYZObject(withJson: jsonstuff)
斯威夫特給我的錯誤:Incorrect argument label in call (have 'withJson:', expected 'withName:')
我對swift和iOS開發相當新穎。我在這裏錯過了什麼?
感謝您的幫助!
什麼是'jsonstuff'? – NobodyNada
「JSON」類型的變量 – Matt