Possible Duplicate:
Objective-C constants: NSString comparison using ==?
i have a textfiela nd label and want the label to display certain text when text is in the textfield here is what i have so far
- (IBAction)Button {
if (Textfield1.text = @"A") {
int text = arc4random() % 3;
switch (text) {
case 0:
Label1.text = @"Red";
break;
case 1:
Label1.text = @"Blue";
break;
case 2:
Label1.text = @"Green";
break;
case 3:
Label1.text = @"Yellow";
break;
default:
break;
}
}
}
all that happens is if prints the letter a in the textfield
any ideas?