Я нашел проблему.Оказывается, я использовал NSButton
вместо UIButton
, поэтому я изменил объявление на: NSButton *theButton = (NSButton *)sender;
.
Затем я заменил theButton.enabled = NO;
на [theButton setEnabled = NO];
.
Итак, вот мой законченный код:
- (IBAction)hit:(id)sender {
Application *app = [[Application alloc] init];
NSButton *theButton = (NSButton *)sender;
int nc = [app dealCard];
[userOne setIntValue:tu];
[userTwo setIntValue:nc];
tu += nc;
[totalUser setIntValue:tu];
BOOL bust = [app checkBust:tu];
if (bust == YES) {
[console setIntValue:1];
[theButton setEnabled = NO];
}
}