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

前端 未结 2 1058
谎友^
谎友^ 2020-12-04 01:53

Storyboard iAd Tab Bar Controller sample project

1: Download sample project for Xcode 4.2

2: Make the banner visible above the Tab Bar from every view

<
相关标签:
2条回答
  • 2020-12-04 02:30

    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];
    
    0 讨论(0)
  • 2020-12-04 02:44

    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.

    0 讨论(0)
提交回复
热议问题