我已经正确连接按钮,所以它一定是代码有问题。当我在模拟器中触摸按钮时,里面不会有 X。并且没有其他迹象。
- (IBAction)SelectButton:(id)sender{
if (boxSelected == 0){
[Checkbox setSelected:YES];
boxSelected = 1;
} else {
[Checkbox setSelected:NO];
boxSelected = 0;
}
}
- (void)viewDidLoad {
boxSelected = 0;
[super viewDidLoad];
}
- (void)dealloc {
}