2012-08-02 51 views
0

我在我的iPhone應用程序的之一,有時使用iAd的,當它不能加載它熄滅屏幕,這是使用的代碼IM:如何在iAd未加載時出現錯誤消息?

-(void)bannerView:(ADBannerView *)aBanner didFailToReceiveAdWithError:(NSError *)error { 
if (!self.bannerIsVisible) { 
    [UIView beginAnimations:@"animatedAdBannerOff" context:NULL]; 
    banner.frame = CGRectOffset(banner.frame, 0.0, -320.0); 
    [UIView commitAnimations]; 
    self.bannerIsVisible = NO; 
} 

的事情是,當它doesent載有剛有空白,我會如何寫一個標籤錯誤廣告無法加載,或類似的東西?感謝

+0

你是什麼意思時,它不會加載存在的僅僅是空白做?如果它正確加載,您應該使其動畫顯示在屏幕上。如果它沒有加載,你不應該做任何動畫,只是讓它保持隱藏。爲什麼會有空白? – MikeS 2012-08-02 13:59:53

回答

2

使用UIAlertView

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Could not display iAd" delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil]; 

     [alert show];