2016-07-22 52 views
1

我知道这是一个常见问题,但在阅读所有类似问题后我没有找到我的答案。SplashScreen和HomePage之间的间隙(塞格不工作,黑屏)

因此,这里是我的问题,我在整合我的应用程序广告,基本上我想要做到的,是刚刚访问HomePageSplashScreen期间表现出Interstitial

现在这就是我:

- 启动应用程序 - >显示闪屏 - >显示主页,并在之后展示插页。

我想要什么:

- 启动应用程序 - >显示闪屏 - >展示插页和广告时被关闭,显示主页。

我可以SplashScreen期间显示Interstitial,但我的performSegueWithIdentifier不工作,要么就说明我Blackscreen或在Splas enter code here hScreen的应用程序块。

为了说明我在说什么,这里是我的SplashScreenViewController的一些代码。

- (void)loadHomeView 
{ 
    if(_isDataLoaded && !_isInterstitialDisplay && [MFPreferencesUtils firstLaunch] != nil) 
    { 
     [self createSplashInterstitial]; 
     //I also tried with performSelectorOnMainThread 
    } 
} 

的间质性代表:

-(void)adsAdapterInterstitialDisappear:(Adapter *)adsAdapter{ 
    _isInterstitialDisplay = NO; 
    [self displayHome]; 
} 

而且displayHome方法,被称为当用户关闭广告:

-(void) displayHome 
{ 
    dispatch_async(dispatch_get_main_queue(), ^{ 
     [self performSegueWithIdentifier:@"SplashscreenDisappearToHome" sender:self]; 
    }); 
} 

我认为这是一个简单的行为,也许我不我真的不明白Segues是如何工作的,但如果我不打电话给Interstitial,而是直接打电话给我的HomePage,它就可以工作。

- (void)loadHomeView 
{ 
    if(_isDataLoaded && !_isInterstitialDisplay && [MFPreferencesUtils firstLaunch] != nil) 
    { 
     [self performSelectorOnMainThread:@selector(displayHome) withObject:nil 
    waitUntilDone:NO]; 
    } 
} 

谢谢你的阅读,让我知道你是否有一些建议。

+1

据我记得,你不能真正控制插页式生命周期,因为它被视为一种模式。我的代码完全符合您的要求,但现在无法访问它。我建议你要做的是:创建一个模拟你的启动画面的主屏幕; 从那里打电话给您的插页式广告;收听插页式关闭回叫,以执行到下一个屏幕的转入。 – Bienemann

回答

0

问题解决了,我可以通过在viewDidAppear中调用我的方法来修复它。这是一个调用来执行塞格当我的视图尚未加载,因为Interstitial。