2009-12-16 5 views
0

빈 값을 가진 컨트롤러에서 돌아온 후 경고가 팝업되는 프로젝트에서 작업하고 있습니다. 시뮬레이터에서는 팝업되지만 아이폰에서는 컨트롤러에서 돌아 오면 앱이 멈추고 종료됩니다. 어떤 아이디어?아이폰 : UIAlertView는 시뮬레이터에서 작동하지만 아이폰에서 앱을 멈추게합니다

- (void)manualBarcodeViewControllerDidFinish:(ManualBarcodeViewController *)controller 
    { 

     ...... 
     ...... 

     else if([barcode isEqualToString:@""]) 
     { 
      UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"error" message:@"message" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"otherbutton"]; 
      [alert show]; 
     [alert release]; 
     } 
    } 
+0

스택 추적이 때 응용 프로그램이 충돌 무엇 예를 들면? –

+0

iPhone이 연결되었을 때 Xcode Organizer를 열면 응용 프로그램에서 사용 가능한 충돌 덤프가 표시됩니다. 그런 다음 문제를 진단하는 데 도움이되는 스택 추적을 게시 할 수 있습니다. –

+0

아 .. 멋지다. 아직 알지 못했다. 여전히 xcode에 새로운 ... – Madoc

답변

2

귀하의 otherButtonTitles 인수는 nil을 종료해야합니다.

일반적으로 가변 개수의 인수를 사용하는 메서드는 끝에 nil이 있어야합니다.

[NSArray arrayWithObjects:objA, objB, nil]; 

및 귀하의 경우 :

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"error" message:@"message" delegate:self cancelButtonTitle:@"cancel" otherButtonTitles:@"otherbutton", nil]; 
+0

그래, 그게 문제였다, 고마워. :) – Madoc

관련 문제