Text 单击操作时,它无法在控件中显示
问题=无法将按钮操作(设置标签文本)反映到标签Text 单击操作时,它无法在控件中显示,text,label,Text,Label,问题=无法将按钮操作(设置标签文本)反映到标签 -背景解释- 我定义了两个基本按钮(作为操作)&我有一个标签(作为控件) -见下文 我在下面实现了它,当我点击开始或停止按钮时,它应该反映在标签上——见下文- - (IBAction)onStartPressed:(id)sender { stopWatchLabel.text = @"START PRESSED"; } - (IBAction)onStopPressed:(id)sender { stopWatchLabel.t
-背景解释- 我定义了两个基本按钮(作为操作)&我有一个标签(作为控件) -见下文
我在下面实现了它,当我点击开始或停止按钮时,它应该反映在标签上——见下文-
- (IBAction)onStartPressed:(id)sender {
stopWatchLabel.text = @"START PRESSED";
}
- (IBAction)onStopPressed:(id)sender {
stopWatchLabel.text = @"STOP PRESSED";
}
但是,当我点击开始按钮或停止按钮(当我运行程序时),什么都没有发生 请告诉我我错过了什么
- (IBAction)onStartPressed:(id)sender {
stopWatchLabel.text = @"START PRESSED";
}
- (IBAction)onStopPressed:(id)sender {
stopWatchLabel.text = @"STOP PRESSED";
}