Swift: I get Debugging "errors" when I try to make my program work -
Swift: I get Debugging "errors" when I try to make my program work -
i followed online tutorial on youtube hello world programme swift. though typed code code in tutorial till gives me debugging error (the greenish errors). researched problems code complicated , on head. code in java, have been wanting develop mobile. anyways, if can tell me: 1. error means. 2. how can prepare it. 3. how can prevent errors this.
namelabel.text = "hi (nametextfield.text)" line error on. here code:
import uikit class viewcontroller: uiviewcontroller { @iboutlet var namelabel: uilabel! override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } @ibaction func helloworldaction(nametextfield: uitextfield) { namelabel.text = "hi \(nametextfield.text)" } }
nametextfield is't @ibaction. it's @iboutlet. made button , appropriated action. have working.
@ibaction func button(sender: uibutton!) { namelabel.text = "hi \(namedtextfield.text)" } swift
Comments
Post a Comment