Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How can I get the current view controller / window for my iOS module? ...

$
0
0

Hi,

I am trying to build an Appcelerator Module for a native iOS Framework. Until now everything works fine. I got my module to work and other methods work, but the main thing, the interstitial ads are my main problem!

I don't know how to get from ObjectiveC my current ViewController? That is what I should include. I included those methods in my Module.m file and also imported the "TiApp.h" header.

-(void)interstitialAdDidLoadAd:(ASKPInterstitialAd *)interstitialAd
{
    if(interstitialAd.loaded)
        [interstitialAd presentFromViewController:self];
}
 
-(void)interstitialAd:(ASKPInterstitialAd *)ad didFailToLoadAdWithError:(NSError *)error
{
    // If using ARC
    ad = nil;
 
    // If not using ARC
    [ad release];
}
 
-(void)interstitialAdWillDisappear:(ASKPInterstitialAd *)interstitialAd
{
    // If using ARC
    interstitialAd = nil;
 
    // If not using ARC
    [interstitialAd release];
}
Has anybody an idea?

Viewing all articles
Browse latest Browse all 8068

Trending Articles