Shared iAd banner for UITabBarController based app using XCode 4 with storyboard

て烟熏妆下的殇ゞ 提交于 2019-11-27 16:09:29

It's fairly simple actually. Just create a new banner view controller for each tab that will be the parent view controller for each tab in your storyboard. Then drag in a Container View object into each banner view controller and embed your child view controllers in each banner view controller.

Finally in BannerViewController.m replace the custom init method a method to override initWithCoder: where you will add the banner view controller to the banner manager. Also implement prepareForSegue: where you can set the _contentController to the segue's destination view controller.

My blog post goes into a lot more detail and links to an example project.

Before we try anything drastic, try putting this code at the bottom of your appDidFinishLaunchingWithOptions, just before your return YES; call:

self.window.rootViewController = tabBarController;
[self.window makeKeyAndVisible];
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!