我已多次检查以确保我的连接在IB中正确。
// This does not work
UIButton *additionButton = [self.gameShopCoinButtonCollection objectAtIndex:0];
additionButton.enabled = NO;
// This does work
-(IBAction)gameShopBuyButtonPressed:(UIButton *)sender {
sender.enabled = NO;
}
答案 0 :(得分:0)
禁用 -
additionButton.userInteractionEnabled = NO;
答案 1 :(得分:0)
您无法保证IBOutletCollection中商品的顺序。您需要直接引用该按钮并以此方式禁用它。