SORU
16 Aralık 2010, PERŞEMBE


Basit bir UİAlertView ekleme

"OK" düğmesi ile mi? basit bir UİAlertView yapmak için işime yarar bir marş kodu nedir

CEVAP
16 Aralık 2010, PERŞEMBE


Uyarı göstermek istediğinde, bunu yapmak için:

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"ROFL" 
                                                    message:@"Dee dee doo doo." 
                                                    delegate:self 
                                                    cancelButtonTitle:@"OK" 
                                                    otherButtonTitles:nil];
    [alert show];

    // If you're not using ARC, you will need to release the alert view.
    // [alert release];

Eğer düğmesine tıklandığında bir şeyler yapmak istiyorsanız, bu temsilci yöntemi uygulayın:

- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
    // the user clicked OK
    if (buttonIndex == 0) {
        // do something here...
    }
}

Ve temsilci UIAlertViewDelegate Protokole uygun olduğundan emin olun:

@interface YourViewController : UIViewController <UIAlertViewDelegate> 

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Anthony Le

    Anthony Le

    10 EKİM 2006
  • fouseyTUBE

    fouseyTUBE

    21 Mart 2011
  • HTC

    HTC

    12 Ocak 2006