What am I doing wrong with this conditional statement using a UILabel
in Xcode?
Over simplified example, but I am trying to change the content of the UILabel
in relation to text in the UILabel
.
-(IBAction)answerQuestion:(id)sender{
NSString *startingLableContent = @"Do dogs bark?";
NSString *answer = @"Yes.";
NSString *askAnother = @"What else do you want?";
if (mainLable.text == startingLableContent) {
mainLable.text = answer;
}else if (mainLable.text == answer){
mainLable.text = askAnother;
}
}