나는이 앱에 정말 의아해하고 있습니다. 제 신청서에 두 권의 UIActionSheets을 설정했습니다. UIActionSheets에서 취소 버튼을 사용하기 전까지는 완벽하게 작동합니다.UIActionSheet 취소 버튼으로 인해 내 앱이 계속 계속 작동합니다.
페이지에서 나가면 UIAactionSheet도 반환되어 내 응용 프로그램이 손상됩니다.
누구에게도 아이디어가 있습니까?
-(IBAction) phoneButtonClicked:(id)sender
{
// open a dialog with just an OK button
phoneActionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:[NSString stringWithFormat:@"Phone: %@",phone],nil];
phoneActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[phoneActionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table)
[phoneActionSheet release];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (actionSheet == phoneActionSheet) {
if(buttonIndex == 0){
NSString *callPhone = [NSString stringWithFormat:@"tel:%@",phone];
NSLog(@"Calling: %@", callPhone);
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];
}
}
}
응용 프로그램이 충돌 할 때 콘솔에 아무 것도 기록되지 않습니까? 그렇다면 메시지를 게시하는 것이 도움이 될 것입니다. – jlehr