I have integrated iAd in my application and i am executiong it in my simulator. I kept the target iOS 4.1. But some times I am getting the error:
"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.
I statically added the ADBannerView in interface builder and used the delegate methods like this:
#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;
}
If any one know the solution please help me.
Exception:
Suggests that your delegate object going out of scope. It may be because you have created it in auto-release pool or releasing it somewhere. You will need to retain it.
Thanks