문제

내 프로젝트에서 내 앱은 먼저 인터넷에 연결하려고 시도하지만 이제 사용할 수있는 연결이 있는지 확인해야합니다! 그래서 나는 다른 부분의 uialertview 내에서 IF를 만들었습니다!

그러나 다음 버튼을 클릭하여 전체 앱을 어떻게 닫을 수 있습니까?

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Keine Internetverbindung" message:@"Es konnte keine Verbindung zu www.sip.de hergestellt werden!" delegate:nil cancelButtonTitle:@"Schliessen" otherButtonTitles:nil];

미리 도와 주셔서 감사합니다

마르코 인사

도움이 되었습니까?

해결책

.H 파일

@Interface UntitledViewController : uiviewController <uialertViewDelegate> {}

.M 파일


- (void)viewDidLoad {
    [super viewDidLoad];

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Keine Internetverbindung" message:@"Es konnte keine Verbindung zu www.sip.de hergestellt werden!" delegate:nil cancelButtonTitle:@"Schliessen" otherButtonTitles:nil];

    [alert setDelegate:self];
    [alert show];
    [alert release];
}

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
    exit(0);
}

도움이 되었기를 바랍니다

다른 팁

UialertViewConfigure :

uialertView *ApplicationExitalert = [[uialertView alloc] initwithTitle :@"Exit"메시지 :@"@"re -you wanto this 앱 "이 앱을 종료하기를 원합니다.

ApplicationExitalert show]; [ApplicationExitalert 릴리스];

uialertViewDelegate :

  • (void) AlertView : (uialertView *) AlertView ClickEdButtonatIndex : (nsinteger) buttonIndex {if (buttonIndex == 1) {exit (0); }}

나는 그것의 일을 바랍니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top