我已在我的应用程序中集成了iAd,我在我的模拟器中执行它。我保留了目标iOS 4.1。但有时我收到错误:
"Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString bannerViewDidLoadAd:]: unrecognized selector sent to instance 0x6451cd0' " and the application will be quit. What i have to do.
我在界面构建器中静态添加了ADBannerView
并使用了这样的委托方法:
#pragma mark ADBannerViewDelegate
- (void)bannerViewDidLoadAd:(ADBannerView *)banner {
Class classAdBannerView = NSClassFromString(@"ADBannerView");
if(classAdBannerView!= nil)
iAdView2.hidden = NO;
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
Class classAdBannerView = NSClassFromString(@"ADBannerView");
if(classAdBannerView!= nil)
iAdView2.hidden = YES;
}
如果有人知道解决方案,请帮助我。
答案 0 :(得分:0)
例外:
NSInvalidArgumentException', reason:
'-[NSCFString bannerViewDidLoadAd:]: unrecognized selector sent to instance 0x6451cd0' "
建议您的委托对象超出范围。这可能是因为您已在自动发布池中创建它或在某处释放它。你需要保留它。
由于