0
Возможно, тупая ошибка, но мне просто нужно знать, почему мое приложение отключается после нажатия кнопки. Он дает желаемый ответ на секунду или два, а затем выключается. Зачем? Тогда он берет меня к этому:Ошибка приложения после запуска метода
1{
2 @autoreleasepool {
3 return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
4 }
5}
Линия 3 заштрихована зеленым и говорит: «Тема 1: сигнал SIGBART» на правой стороне.
Это код:
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
//dismiss the keyboard
[textField resignFirstResponder];
return YES;
}
@synthesize go;
@synthesize start;
@synthesize calc;
@synthesize answer;
@synthesize input;
@synthesize count;
- (void)updateTipTotals
{
int fuzzy = [input.text intValue];
//handle divide by 0
if (fuzzy %3 == 0 && fuzzy % 7 == 0) {
answer.text = @"Fuzzy Ducky";
}else {
if (fuzzy% 7 == 0) {
answer.text = @"Ducky";
}
else {
if (fuzzy % 3 == 0) {
answer.text = @"Fuzzy";
}else {
answer.text = input.text;
}
}
}
}
-(IBAction)calcTouchDown:(id)sender{
[self updateTipTotals];
}
- (void)viewDidLoad
{
[super viewDidLoad];
//this informs the text fields the controller is their delegate
input.delegate = self;
start.delegate = self;