按下btn1后,我无法更改UIButton btn2的标题。当我使用_definition settitle:@"Show Word" forState: UIControlStateNormal
时,它会更改原始的btn1。
以下是您的评论代码,
- (IBAction)mynextPressed:(UIButton *)sender {
//Display the string in the label field
[self.WordDisplay setText:vocabulary];
//reset center button with "show word"
[_definitionPressed setTitle:@"Show Word" forState:UIControlStateNormal];
NSLog(@"displaying word: %@", _definitionPressed.titleLabel);
}
答案 0 :(得分:1)
尝试以下方面的内容:
[btn2 setTitle:@"Show Word"]
答案 1 :(得分:0)
[_definitionPressed setTitle:@"Normal State" forState:UIControlStateNormal];
[_definitionPressed setTitle:@"Selected State" forState:UIControlStateHighlighted];