1

我正在尝试将 iAd 添加到我使用 Storyboards 设置的基于标签的应用程序中。我正在关注 Apple 的 iAdSuite 示例代码中的 TabbedBanner 示例。我已经导入 BannerViewController 并设置了以下内容:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  UITabBarController* tabBarController = (id)self.window.rootViewController;
CGRect tabBarViewFrame = tabBarController.view.frame;
tabBarViewFrame.origin.y -= application.statusBarFrame.size.height;
tabBarViewFrame.size.height += application.statusBarFrame.size.height;
tabBarController.view.frame = tabBarViewFrame;

self.window.rootViewController = [[BannerViewController alloc] initWithContentViewController:tabBarController];
}

我已将以下内容添加到我的 SummaryViewController

    - (void)viewDidLoad
{
    [super viewDidLoad];
    appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willBeginBannerViewActionNotification:) name:BannerViewActionWillBegin object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didFinishBannerViewActionNotification:) name:BannerViewActionDidFinish object:nil];
}

广告当前显示在标签栏下方?另外,我的观点的内容也消失了。

4

1 回答 1

0

**不要在最后一段代码中使用nilfor 。bundle使用[NSBundle mainBundle].

于 2013-03-18T21:15:39.407 回答