Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ljg93

macrumors member
Original poster
Mar 13, 2011
98
0
hey guys i am adding ads to my app

i have a tab bar application and put adds on three of the tabs

to do this i dragged a add from the libary to where i want it to be

for each view controller that corrisponded to the tab i made it a ad delegate imported the ad framwork and made it a property and IBOutlet, i linked everything up in interface builder the ad to delegate and delegate to add, but the ad only randomly runs on my device.. why? heres my code

Code:
#import <UIKit/UIKit.h>
#import "TableViewController.h"
#import <iAd/iAd.h>
@class TableViewController;
@interface AddViewController : UIViewController <UITextFieldDelegate,ADBannerViewDelegate>


{
	
	UITextField *nameField;
	UITextField *descriptionField;
	TableViewController *delegate;
	ADBannerView *banner;
}
@property (nonatomic, assign) TableViewController *delegate;
@property (nonatomic, assign) IBOutlet UITextField *nameField;
@property (nonatomic, assign) IBOutlet UITextField *descriptionField;


- (IBAction)cancel:(id)sender;

@property(nonatomic, retain) IBOutlet ADBannerView *banner;
- (void)save;
- (void)cancel;

@end
 
Last edited:
hey guys i am adding ads to my app

i have a tab bar application and put adds on three of the tabs

to do this i dragged a add from the libary to where i want it to be

for each view controller that corrisponded to the tab i made it a ad delegate imported the ad framwork and made it a property and IBOutlet, i linked everything up in interface builder the ad to delegate and delegate to add, but the ad only randomly runs on my device.. why? heres my code

Code:
#import <UIKit/UIKit.h>
#import "TableViewController.h"
#import <iAd/iAd.h>
@class TableViewController;
@interface AddViewController : UIViewController <UITextFieldDelegate,ADBannerViewDelegate>


{
	
	UITextField *nameField;
	UITextField *descriptionField;
	TableViewController *delegate;
	ADBannerView *banner;
}
@property (nonatomic, assign) TableViewController *delegate;
@property (nonatomic, assign) IBOutlet UITextField *nameField;
@property (nonatomic, assign) IBOutlet UITextField *descriptionField;


- (IBAction)cancel:(id)sender;

@property(nonatomic, retain) IBOutlet ADBannerView *banner;
- (void)save;
- (void)cancel;

@end


I would suggest looking over the documentation. In any event this is normal behavior.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.