0
votes

I am done with all the code for a sprite-Kit game, but iAd gave me lot of hard time. When iAd is clicked the game restarts again. How to fix this problem? I have the game with viewController , title Scene, levelOne Scene, level two scene. I read other related post but couldn't solve the issue. Thanks you.

viewController.h

#import <iAd/iAd.h>

@interface RAViewController
@property (nonatomic, strong) ADBannerView *adView;
@end

viewController.m

-(void)viewDidLoad{

    ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
    [adView setFrame:CGRectMake(0, 0, 1024, 768)]; // set to your screen dimensions
    [adView setBackgroundColor:[UIColor clearColor]];
    [self.view addSubview:adView];
}
1

1 Answers

0
votes
adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.delegate = self;
[adView setFrame:CGRectMake(0, 0, 1024, 768)]; // set to your screen dimensions
[adView setBackgroundColor:[UIColor clearColor]];
[self.view addSubview:adView];

maybe delegate helps you. I didn't try this code, try it tell me if it works.