I've been reading all evening and it seems that to get an adWhirl ad use the same add banner across all view controllers, I need to create a singleton awView and use this in the ViewWillLoad & ViewWillUnload of each View.
I am having trouble getting this to work. I've found tons of AdWhirl tutorials but none that create a singleton.
I currently have this adWhirlSingleton.h
#import <Foundation/Foundation.h>
#import "AdWhirlDelegateProtocol.h"
#import "AdWhirlView.h"
@interface adWhirlSingleton : NSObject <AdWhirlDelegate> {
AdWhirlView *awView;
UIViewController *primaryView;
}
@property (strong, nonatomic) AdWhirlView *awView;
@property (strong, nonatomic) UIViewController *primaryView;
@end
adWhirlSingleton.m
#import "adWhirlSingleton.h"
@implementation adWhirlSingleton
@synthesize primaryView, awView;
-(NSString *)adWhirlApplicationKey
{
return @"my key here";
}
-(UIViewController *)viewControllerForPresentingModalView
{
return primaryView;
}
@end
I import adWhirlSingleton into my views, but when I type adWhirlSingleton.primaryView = self I doesn't recognize the primaryView.
What am I missing to implement this? Thanks