현재 iOS 응용 프로그램 상단에 Adwhirl보기를 추가하려고합니다. 응용 프로그램은 다섯 개의 다른보기로 구성되며, 모두 단일 TabBarController의 제어를받습니다. 누구든지이 작업을 수행하는 데 필요한 코드를 보여주는 간단한 자습서를 작성할 수 있습니까? 나는 보았고 그곳에 많은 해결책을 시도했지만 그들 중 누구도 일을하지 않고있다.tabBarController에 AdWhirl보기 추가
다음은 현재 내 문제를 시도한 것입니다. 오류는 발생하지 않지만 화면에 다른 내용은 표시되지 않습니다. 미리 감사드립니다.
@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 {
}