Alright so this is my last problem for some reason someone at apple decided to name iad and ipad. google thinks iad is ipad and its rubbish....
I checked the search button here but i couldn't find the problem i am having. I have my app ready to go for the most part everything is functional. I am using a tab bar type app that does not use storyboard. I am applying iads to both firstviewcontroller and the secondviewcontroller. The firstviewcontroller doesn't even load the iad and the second one loads it but it wont place its 380 it places it at the top no matter what when it loads. half the time iad doesn't even initiate. here is the snippets / screenshots.
i added this in both .m files to allow it to load or not load.
this is the other .m part in both:
and the .h part. the ad part is also in both exactly the same:
380 is at the bottom of the screen right above the tab bar as seen in the screen shots the first view nothing it jsut gives me "bannerViewDidLoadAd" and shows no ad. then in the other one if it loads it loads at the top if it doesn't load it also gives "bannerViewDidLoadAd."
it is set to make the ad windows on start up i see in xcode their is a ad windo i can use but then if theirs no ad the window stays there and i heard apple hates it.
I also read that that you must include the 2 functions to hide the ad when their is no ad so apple wont reject the app. Im not sure what to do but ill keep playing withit and hopefully it works
edit: when i did use the xcode window that you drag into the .xib files it would load an ad in both controllers but it wouldn't hide the ad if their wasn't an add so i tried this method.
I checked the search button here but i couldn't find the problem i am having. I have my app ready to go for the most part everything is functional. I am using a tab bar type app that does not use storyboard. I am applying iads to both firstviewcontroller and the secondviewcontroller. The firstviewcontroller doesn't even load the iad and the second one loads it but it wont place its 380 it places it at the top no matter what when it loads. half the time iad doesn't even initiate. here is the snippets / screenshots.
i added this in both .m files to allow it to load or not load.
Code:
- (void)bannerViewDidLoadAd:(ADBannerView *)banner {
NSLog(@"bannerViewDidLoadAd");
if (!self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOn" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0, 380);
[UIView commitAnimations];
self.bannerIsVisible = YES;
}
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
NSLog(@"bannerViewRecievedError");
if (self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
banner.frame = CGRectOffset(banner.frame, 0, -380);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
this is the other .m part in both:
Code:
- (void)viewDidLoad {
[super viewDidLoad];
adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
adView.frame = CGRectOffset(adView.frame, 0, -380);
[self.view addSubview:adView];
adView.delegate=self;
self.bannerIsVisible=NO;
and the .h part. the ad part is also in both exactly the same:
Code:
#import <UIKit/UIKit.h>
#import <iAd/iAd.h>
@interface SecondViewController : UIViewController <UIPickerViewDelegate, UIPickerViewDataSource, ADBannerViewDelegate>{
ADBannerView *adView;
BOOL bannerIsVisible;
IBOutlet UITextField *billTotal;
IBOutlet UILabel *profitAmount;
IBOutlet UIPickerView *profitPicker;
NSMutableArray *pickerViewArray;
float profitSelected;
}
@property (nonatomic,assign) BOOL bannerIsVisible;
@property (nonatomic,retain) IBOutlet UITextField *BillTotal;
@end
380 is at the bottom of the screen right above the tab bar as seen in the screen shots the first view nothing it jsut gives me "bannerViewDidLoadAd" and shows no ad. then in the other one if it loads it loads at the top if it doesn't load it also gives "bannerViewDidLoadAd."
it is set to make the ad windows on start up i see in xcode their is a ad windo i can use but then if theirs no ad the window stays there and i heard apple hates it.
I also read that that you must include the 2 functions to hide the ad when their is no ad so apple wont reject the app. Im not sure what to do but ill keep playing withit and hopefully it works
edit: when i did use the xcode window that you drag into the .xib files it would load an ad in both controllers but it wouldn't hide the ad if their wasn't an add so i tried this method.
Attachments
Last edited: