Xcode iAd在构建时有时会起作用

Xcode iAd在构建时有时会起作用,xcode,iad,Xcode,Iad,iAd的构建有时是有效的。虽然我不想我的应用被拒绝,但大多数时候我都是这样。当它工作时,它工作得很好。没有错误,也没有调试错误。但当它不起作用时,以下是GDP调试错误: [Session started at 2011-04-28 16:51:17 +0800.] 2011-04-28 16:51:21.943 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implem

iAd的构建有时是有效的。虽然我不想我的应用被拒绝,但大多数时候我都是这样。当它工作时,它工作得很好。没有错误,也没有调试错误。但当它不起作用时,以下是GDP调试错误:

[Session started at 2011-04-28 16:51:17 +0800.]
2011-04-28 16:51:21.943 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=3 "The operation couldn’t be completed. Ad inventory unavailable" UserInfo=0x621b8d0 {ADInternalErrorCode=3, NSLocalizedFailureReason=Ad inventory unavailable}
2011-04-28 16:51:22.780 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x575b870 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:23.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5714f80 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:24.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x57584f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:25.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5744b00 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:26.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x621c9d0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:27.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x570fe40 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:28.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x621c9d0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:29.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x621c9d0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:30.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5758530 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:31.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x575b870 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:32.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5744b00 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:33.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x57584f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:34.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5714f80 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:35.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x570fe40 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:36.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5758530 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:37.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x62189f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:38.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x62189f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:39.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x575b870 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:40.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x62189f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:41.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5744b00 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:42.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x57584f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:43.780 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5714f80 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:44.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x570fe40 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:45.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x62189f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:46.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x62189f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:47.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x62189f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:48.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x62189f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:49.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5758530 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:50.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x57584f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:51.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5744b00 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:52.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x621da50 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:53.609 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=3 "The operation couldn’t be completed. Ad inventory unavailable" UserInfo=0x5744b00 {ADInternalErrorCode=3, NSLocalizedFailureReason=Ad inventory unavailable}
2011-04-28 16:51:53.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x575b870 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:54.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x570fe40 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:55.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x57584f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:56.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5744b00 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:57.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x575b870 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:58.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5714f80 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:51:59.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x621a000 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:52:00.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x621a000 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:52:01.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x621a000 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:52:02.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5717d90 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:52:03.779 Illuminator[35952:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x621a000 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}

[Session started at 2011-04-28 16:52:05 +0800.]
2011-04-28 16:52:08.109 Illuminator[35977:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=3 "The operation couldn’t be completed. Ad inventory unavailable" UserInfo=0x57422e0 {ADInternalErrorCode=3, NSLocalizedFailureReason=Ad inventory unavailable}
2011-04-28 16:52:08.631 Illuminator[35977:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5744ad0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:52:09.631 Illuminator[35977:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5743ec0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:52:10.631 Illuminator[35977:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5743ec0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:52:11.631 Illuminator[35977:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x62395f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:52:12.631 Illuminator[35977:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5743ec0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:52:13.631 Illuminator[35977:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5743ec0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:52:14.631 Illuminator[35977:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x5743ec0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
2011-04-28 16:52:15.631 Illuminator[35977:207] ADBannerView: Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:): Error Domain=ADErrorDomain Code=5 "The operation couldn’t be completed. Banner view is visible but does not have content" UserInfo=0x62395f0 {ADInternalErrorCode=5, NSLocalizedFailureReason=Banner view is visible but does not have content}
以下是我所有的编码:

.h:

#import <UIKit/UIKit.h>
#import <iAd/iAd.h>

@interface RootViewController : UIViewController <ADBannerViewDelegate> {

    BOOL bannerIsVisible;
    ADBannerView *banner;
}

-(IBAction)Press:(id)sender;
-(IBAction)Pink:(id)sender;
-(IBAction)Yellow:(id)sender;
-(IBAction)Red:(id)sender;
-(IBAction)Blue:(id)sender;
-(IBAction)Green:(id)sender;
-(IBAction)Orange:(id)sender;

@property (nonatomic, assign) BOOL bannerIsVisible;
@property (nonatomic, retain) IBOutlet ADBannerView *banner;

@end


(ignore the button actions)


.m:


@synthesize banner, bannerIsVisible;

-(void)bannerViewDidLoadAd:(ADBannerView *)aBanner {

    if (!self.bannerIsVisible) {
        [UIView beginAnimations:@"animateAdBannerOn" context:NULL];
        // assumes the banner view is at the top of the screen.
        banner.frame = CGRectOffset(banner.frame, 0.0, 50.0);
        [UIView commitAnimations];
        self.bannerIsVisible = YES;

    }

}

-(void)bannerView: (ADBannerView *)aBanner didFailToReceiveAdWithError:(NSError *)error {
    if (self.bannerIsVisible) {
        [UIView beginAnimations:@"animateAdBannerOff" context:NULL];
        // assumes the banner view is at the top of the screen.
        banner.frame = CGRectOffset(banner.frame, 0.0, -320.0);
        [UIView commitAnimations];
        self.bannerIsVisible = NO;
    }
}
还有一段代码谈到了接口方向,但我的ap不支持,所以我删除了它。在此之前,这个错误仍然存在


谢谢大家!

正如Hugo所建议的,配置 [代表:自我]; 解决了这个问题


问候。

您在IB中为您的横幅设置了代表吗?否则这可能是您的问题…是的,我做到了,它在这里:@interface RootViewController:UIViewController{BOOL bannerIsVisible;ADBannerView*banner;}我的意思是:您是否将banner的委托属性分配给了UIViewController?在objective-C中是[banner setDelegate:self];在IB中,它将把横幅的委托属性链接到文件的所有者。