0

尝试将文本设置为按钮时收到警告 UIButton 可能无法响应 -'settitle'。

对于下面的代码行。

[firstButton setTitle:[buttonArray objectAtIndex:0]];

[secondbutton setTitle:[buttonArray objectAtIndex:i+index]];
4

2 回答 2

4

尝试:

[firstButton setTitle:[buttonArray objectAtIndex:0] forState:UIControlStateNormal];

[secondbutton setTitle:[buttonArray objectAtIndex:i+index] forState:UIControlStateNormal];
于 2012-04-21T12:49:22.177 回答
1

整个方法签名是 – setTitle:forState:

forState: 是方法名的一部分,不是可选参数。

于 2012-04-21T12:49:16.823 回答