ios - Shared iAd on Tabbed Application -
new ios development , have tabbed app 4 tabs. have iad showing on 1 tab , don't want regurgetate code on every view controller , know not correct way implement anyway. have looked @ apple code here , i'm struggling honest.
https://developer.apple.com/library/ios/samplecode/iadsuite/introduction/intro.html
i have included bannerviewcontroller.m , bannerviewcontroller.h in application i'm not sure how run ad on each view controller.
yours confused
jkx
just grab reference of uiwindow in of viewcontroller class go .m of viewcontroller
#import "appdelegate.h" @interface viewcontroller () { //make object of appdelegate appdelegate *appdelegate; }
now in viewdidload or viewdidappear grab reference of window.
appdelegate=(appdelegate*)[uiapplication sharedapplication].delegate; [appdelegate.window addsubview:yourbannerview];
Comments
Post a Comment