Posted: 8th Nov 2011 4:38
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.
+ Code Snippet
// 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.
Posted: 8th Nov 2011 12:29
Looks easy enough.
I will try it asap!

Would love more of these small code snips that give you extra functionality so that we won't have to bother TGC to do them for us!