当尝试将文本设置为按钮获取警告时,UIButton可能无法响应-'settitle'。
以下代码行。
[firstButton setTitle:[buttonArray objectAtIndex:0]];
[secondbutton setTitle:[buttonArray objectAtIndex:i+index]];
答案 0 :(得分:4)
尝试:
[firstButton setTitle:[buttonArray objectAtIndex:0] forState:UIControlStateNormal];
[secondbutton setTitle:[buttonArray objectAtIndex:i+index] forState:UIControlStateNormal];
答案 1 :(得分:1)
整个方法签名是 - setTitle:forState:
forState:是方法名称的一部分,而不是可选参数。