使用带有故事板的XCode 4的基于UITabBarController的应用程序的共享iAd横幅 [英] Shared iAd banner for UITabBarController based app using XCode 4 with storyboard

查看:75
本文介绍了使用带有故事板的XCode 4的基于UITabBarController的应用程序的共享iAd横幅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Storyboard iAd标签栏控制器示例项目

1:下载Xcode 4.2的示例项目

1: Download sample project for Xcode 4.2

2:使横幅广告在每个视图的标签栏上方可见

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

3:发布答案

4:获得赏金

5:让其他人开心,我将对其进行辅导.此重要步骤atm没有可用的现有教程.

5: make other people happy, I will tutorialize it. No place existing tutorial for this important step atm.

推荐答案

实际上相当简单.只需为每个选项卡创建一个新的横幅视图控制器,它将成为情节提要中每个选项卡的父视图控制器.然后将 Container View 对象拖入每个横幅视图控制器中,并将子视图控制器嵌入每个横幅视图控制器中.

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.

最后,在BannerViewController.m中,将自定义init方法替换为覆盖initWithCoder:的方法,在该方法中,您会将横幅视图控制器添加到横幅管理器中.还要实现prepareForSegue:,您可以在其中将_contentController设置为segue的目标视图控制器.

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.

这篇关于使用带有故事板的XCode 4的基于UITabBarController的应用程序的共享iAd横幅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆