First ,you should enable iAd in iTunes connect .
second, define a globe variable in .m file, ADBannerView* adView; then extern it in .h file.
Third,add these code.
// iAd
adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
// use device resolution
char* szTemp = agk::GetDeviceName();
char szName[64];
strcpy(szName, szTemp);
delete szTemp;
int iCmp = strcmp(szName, "ios|iPa");
CGSize windowSize;
if (7==iCmp)
{
windowSize.width = 480;
windowSize.height = 320;
}
else if(100==iCmp)
{
windowSize.width = 1024;
windowSize.height = 768;
}
// frame 66 768
adView.transform = CGAffineTransformMakeRotation ( DEGREES_TO_RADIANS ( 90 ) );
adView.center = CGPointMake ( adView.frame.size.width / 2, windowSize.width / 2 );
[self.view addSubview:adView];
adView.hidden = YES;
at last, you can use adView.hidden = YES, or adView.hidden = NO to control show or hide the iAd.
That's all.
give my best