現在のiOSアプリケーションの上部にAdwhirlビューを追加しようとしています。アプリケーションは、1つのTabBarControllerの制御下にある5つのビューから構成されています。誰もがこれを達成するために必要なコードを示す簡単なチュートリアルを書くことができますか?私は見て、そこに多くのソリューションを試してみましたが、誰もそれを働かせていません。AdWhirlビューをtabBarControllerに追加する
私の現在の試みは問題ですが、エラーは発生しませんが、画面上では何も表示されません。前もって感謝します。
@implementation idoubs2AppDelegate
@synthesize window;
@synthesize tabBarController;
@synthesize contactsViewController;
@synthesize messagesViewController;
@synthesize adwhirlview = adview;
static UIBackgroundTaskIdentifier sBackgroundTask = UIBackgroundTaskInvalid;
static dispatch_block_t sExpirationHandler = nil;
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
AdWhirlView *adView = [AdWhirlView requestAdWhirlViewWithDelegate:self];
[self.tabBarController.view addSubview:adView];
adView.center = CGPointMake(160, 342);
[self.tabBarController.view bringSubviewToFront:adView];
}
- (NSString *)adWhirlApplicationKey {
// return your SDK key
return kSampleAppKey;
}
- (UIViewController *)viewControllerForPresentingModalView {
//return UIWindow.viewController;
return [(idoubs2AppDelegate *)[[UIApplication sharedApplication] delegate] tabBarController];
}
- (void)adWhirlDidReceiveAd:(AdWhirlView *)adWhirlView {
}