У меня есть класс ECGView с подклассом InjuryView.Когда я запускаю код, консоль говорит «lldb», и в методе init для подкласса InjuryView выдается следующая ошибка: Поток 1: EXC_BAD_INSTRUCTION (code = EXC_I386_INVOP, subcode = 0x0).
I'mОтносительно новичок в программировании, и мне трудно понять, почему эта ошибка выдается.Любая помощь будет оценена, спасибо!
class ECGView {
var title: String
var normalImage: UIImage
var markedImageByComponents: [MarkedAnatomyComponent]
var steps: [UIImage]
var stepDescriptions: [String]
var sectionNames: [[String]]
var attribution: String
var injuryList: [[InjuryView]]
var numberOfPages: Int = 0
var anatomyOverlay: Bool = false
var currentStep: Int = 0
var section: Bool = true
init(title: String, normalImage: UIImage, markedImageByComponents: [MarkedAnatomyComponent] = [], steps: [UIImage] = [], stepDescriptions: [String] = [], sectionNames: [[String]] = [], attribution: String, injuryList: [[InjuryView]] = []){
self.title = title
self.normalImage = normalImage
self.markedImageByComponents = markedImageByComponents
self.steps = steps
self.stepDescriptions = stepDescriptions
self.sectionNames = sectionNames
self.attribution = attribution
self.injuryList = injuryList
}
}
class InjuryView: ECGView{
var injuryImage: UIImage
var injuryComponents: [MarkedAnatomyComponent]
var injuryTitle: String
var shortInjuryTitle: String
var injuryAttribution: String
var overviewText: String
var findingsText: String
var managementText: String
var otherTitle: String
var otherText: String
var normalToggle: Bool = false
}
Ошибка выдается здесь>
init(injuryImage: UIImage = #imageLiteral(resourceName: "Placeholder.jpg"), injuryComponents: [MarkedAnatomyComponent], injuryTitle: String = "", shortInjuryTitle: String = "", injuryAttribution: String, overviewText: String, findingsText: String, managementText: String, otherTitle: String = "", otherText: String = ""){
self.injuryImage = injuryImage
self.injuryComponents = injuryComponents
self.injuryTitle = injuryTitle
self.shortInjuryTitle = shortInjuryTitle
self.injuryAttribution = injuryAttribution
self.overviewText = overviewText
self.findingsText = findingsText
self.managementText = managementText
self.otherTitle = otherTitle
self.otherText = otherText
super.init(title: "", normalImage: #imageLiteral(resourceName: "Blank.png"), attribution: "")
self.title = title
section = false
}
Вот скриншот, если это более полезно: