2012-05-10 3 views
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; 

답변

2

가 실행하기 전에 엑스 코드에서 예외 중단 점을 설정하십시오 :

는 코드입니다. 그러면 실제로 충돌을 일으키는 코드 행을 강조 표시해야합니다.

enter image description here

enter image description here

관련 문제