سؤال

في مشروعي، يحاول تطبيقي أولا الاتصال بالإنترنت، ولكن الآن لا بد لي من التحقق مما إذا كان هناك اتصال متاح! لذلك صنعت إذا، آخر داخل UialertView في الجزء الآخر!

ولكن كيف يمكنني إغلاق التطبيق بأكمله على النقر فوق الزر التالي؟

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 file.

LeftfiViewController: 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:

UAIALERTVIEVITITER = [[uialertview lect] initwithtitle: @ رسالة "الخروج"

applitalexialert عرض]؛ [تطبيق ApplicalExitalert]؛

UialertViewDelegate:

  • (الفراغ) AlertView: (uialertview *) alertview clickedbuttonatex: (nsinteger) buttonIndIndEndex {if (buttonIndEndex == 1) {خروج (0)؛ }}

آمل أن يكون عملها

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top