@implementation ViewController
-(IBAction)changelabel {
NSString *string1 =entername.text;
NSString *string2 =@"Alan Shearer";
NSString *string3 =@"Alan Shearer 260 Goals";
if([string1 isEqualToString:string2])
{label.text=string3;}
}
我想要这样,当用户在文本字段中输入“Alan Shearer”时,它会将标签更改为 Alan Shearer