尝试将文本设置为按钮时收到警告 UIButton 可能无法响应 -'settitle'。
对于下面的代码行。
[firstButton setTitle:[buttonArray objectAtIndex:0]];
[secondbutton setTitle:[buttonArray objectAtIndex:i+index]];
尝试:
[firstButton setTitle:[buttonArray objectAtIndex:0] forState:UIControlStateNormal];
[secondbutton setTitle:[buttonArray objectAtIndex:i+index] forState:UIControlStateNormal];
整个方法签名是 – setTitle:forState:
forState: 是方法名的一部分,不是可选参数。