Hi, my iAd is displaying perfectly and rotating fine, when tapped the content pops up and the X closes it. But once the ad closes my whole scene becomes disabled, animations continue but buttons, etc don't pickup any touches. Can anyone help me out?
My iAd Code:
//^etc
controller = [[UIViewController alloc] init];
controller.view.frame = CGRectMake(162, 144, 320, 32);
controller.view.transform = CGAffineTransformMakeRotation(M_PI / 2.0); // turn 180 degrees
adBannerView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adBannerView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifier480x32];
adBannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifier480x32;
[adBannerView setDelegate:self];
[controller.view addSubview:adBannerView];
//Then I add the adView to the openglview of cocos2d
CCDirector *director = [CCDirector sharedDirector];
EAGLView *view = [director openGLView];
[view addSubview:controller.view];
}
return self;
}
- (void)bannerViewActionDidFinish:(ADBannerView *)banner
{
controller.view.frame = CGRectMake(162, 144, 320, 32);
controller.view.transform = CGAffineTransformMakeRotation(M_PI / 2.0); // turn 180 degrees
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
- (void)onExit
{
NSLog(@"Removing iAd");
[adBannerView setDelegate:nil];
[adBannerView removeFromSuperview];
[adBannerView release];
adBannerView = nil;
[super onExit];
}
I have tried the code suggested here: http://www.cocos2d-iphone.org/forum/topic/7521#post-45279
But it simply removed the ad and kept the scene frozen.
Any help would be greatly appreciated, thanks!