ios - xcode9: class AppDelegate: UIResponder, UIApplicationDelegate... Thread 1: signal SIGABRT -
apologies if obvious mistake (new coding!) i'm having couple issues.
1: following error appears when want load simulator in xcode 9:
class appdelegate: uiresponder, uiapplicationdelegate... thread 1: signal sigabrt
this issue appeared after added label "cat years" title , changed background colour in main storyboard.
2: when simulator did work before above changes, cat (imageview) not appear in simulator?
thank suggestions in advance.
import uikit class viewcontroller: uiviewcontroller { @iboutlet weak var agetextfield: uitextfield! @iboutlet weak var resultlabel: uilabel! @ibaction func getage(_ sender: any) { if let age = agetextfield.text { if let ageasnumber = int(age) { let ageincatyears = ageasnumber * 7 resultlabel.text = "your cat " + string(ageincatyears) + " in cat years!" } } } override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } }
you "sigabrt" errors when have outlet disconnected view. can check clicking view controller in storyboard , going connections on side panel. if see extra/duplicate outlet there, causing problem.
in example, have either outlet on text field or outlet in code referencing different text field , field no longer in storyboard.
Comments
Post a Comment