PDA

View Full Version : iAD problems




ljg93
Apr 27, 2011, 04:41 PM
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



#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



Sykte
Apr 27, 2011, 06:41 PM
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



#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.