PDA

View Full Version : What function is called when iAd closes?




Danneman101
Apr 16, 2011, 09:36 AM
I've got an iAd in my iPad app (just dragged and dropped in xib, and then linked to IBOutlet to code) that once the user opens and closes it, an item also disappears from view (segmentbuttons that are set up via code).

If I could just intercept the code when it closes the iAd I could reinstantiate the buttons, so my question is what function is called when the user closes the iAd?



Sykte
Apr 16, 2011, 10:27 AM
I've got an iAd in my iPad app (just dragged and dropped in xib, and then linked to IBOutlet to code) that once the user opens and closes it, an item also disappears from view (segmentbuttons that are set up via code).

If I could just intercept the code when it closes the iAd I could reinstantiate the buttons, so my question is what function is called when the user closes the iAd?

You may want to read over https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/iAd_Guide/iAd_Guide.pdf

Danneman101
Apr 16, 2011, 11:56 AM
I should have said that I've tried the bannerViewActionDidFinish-function, but when dismissing the iAd it isn't called.

Perhaps the problem is that I'm using it incorrectly if that is indeed the function to be used.

.h-fil

#import <iAd/ADBannerView.h>
#import <iAd/iAd.h>

@interface DetailViewController : UIViewController <UIPopoverControllerDelegate, UISplitViewControllerDelegate, UIWebViewDelegate, ADBannerViewDelegate>
{
IBOutlet ADBannerView *addBannerView; // LINKED IN NIB-FILE
}
@property (nonatomic, assign) IBOutlet ADBannerView *addBannerView;


.m-file

......
@synthesize addBannerView;
.....
-(void)bannerViewActionDidFinish:(ADBannerView *)addBannerView
{
NSLog(@"- IAD STOPPED -"); // NOT REACHED
}