Skip to content

Commit

Permalink
add ad to BookDownload
Browse files Browse the repository at this point in the history
  • Loading branch information
qhd committed May 23, 2012
1 parent ffc27bd commit b2f9878
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions DownloadCommon/Controller/BookController.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
#import <UIKit/UIKit.h>
#import "PPViewController.h"

@class GADBannerView;

@interface BookController : PPViewController<UIWebViewDelegate>

@property (nonatomic, assign) int currentIndex;
@property (nonatomic, retain) UILabel *tipsLabel;
@property (nonatomic, retain) UIWebView *webView;
@property (nonatomic, retain) GADBannerView* bannerView;

- (void)showBook:(int)indexValue;
@end
9 changes: 9 additions & 0 deletions DownloadCommon/Controller/BookController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
#import "DownloadItemManager.h"
#import "DownloadItem.h"
#import "UIViewController+DownloadViewControllerAddition.h"
#import "GADBannerView.h"
#import "DownloadAd.h"

@implementation BookController

@synthesize currentIndex;
@synthesize tipsLabel;
@synthesize webView;
@synthesize bannerView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
Expand All @@ -39,6 +42,8 @@ - (void)dealloc
{
[tipsLabel release];
[webView release];
[bannerView release];
[super dealloc];
}

- (void)showTips:(NSString *)text
Expand Down Expand Up @@ -154,7 +159,11 @@ - (void)viewDidLoad

- (void)viewDidAppear:(BOOL)animated
{
if (bannerView == nil){
bannerView = [DownloadAd allocAdMobView:self];
}

[super viewDidAppear:animated];
}

- (void)viewDidUnload
Expand Down

0 comments on commit b2f9878

Please sign in to comment.