Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Text 单击操作时,它无法在控件中显示_Text_Label - Fatal编程技术网

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";
}