A. Shukri
A. Shukri

Reputation: 115

Change name of variable UILabel, IBOutlet in IOS occur error

At first time, when i create UILabel i used address as variable. it worked ok. but when i changed the variable 'address' to 'dropOffAddress'. It become error when i run emulator Iphone. Actually it happen for all UILabel, it cant change the name of variable. I newbie in IOS. How to change the variable name ? I also cant delete the variable, error will occur. How to solve it ?

First when i create the UILabel i put name of label is 'address' then i run it ok. after that i need to change the name of UILabel to 'dropOffAddress'. Then when i run, it have error.

Upvotes: 2

Views: 373

Answers (2)

maxcodes
maxcodes

Reputation: 544

Hey to solve this do the following:

  • Go to your storyboard and right click the label you are trying to rename
  • hit the the x next to your old variable name 'address' to remove the relation between the button and the file you connected it with
  • reconnect the button as you did before by control dragging to the file, this time name it 'dropOffAddress'

Upvotes: 0

SergStav
SergStav

Reputation: 757

Your label's outlets in storyboard has old names. You have to go to the storyboard, find your label then right click and remove old outlet, and create new one.

Upvotes: 1

Related Questions