1
내 iPhone 앱에서 UIActionSheet를 사용하려고하는데 다음과 같은 문제가 있습니다. 취소 버튼을 탭하면 앱이 다운됩니다. actionSheet에서 NSLog 문을 제거하면 : clickedButtonAtIndex : 그렇지 않습니다. "예, 할 수 있습니다"버튼이 제대로 작동하고 콘솔에 로그 문이 표시됩니다. 뭐가 문제 야?UIActionSheet가 내 앱을 취소하는 이유는 무엇입니까?
- (void) doItWithConfirm {
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"do you really wanna do it?"
delegate:self cancelButtonTitle:@"I don't" destructiveButtonTitle: nil
otherButtonTitles:@"Yes, do it", nil];
[actionSheet showInView:self.view];
[actionSheet release];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
NSLog(@"buttonIndex: %@", buttonIndex);
}
이 오브젝트의 NSInteger가 아닙니까? –
그것은 다음과 같이 정의됩니다 : typedef int NSInteger; – Vladimir
힌트 - NSInteger declation buttonIndex를 살펴보십시오. 아무 것도 없습니다 * – willcodejavaforfood