0

i am having trouble merging iAD into my current code/definition. i already have code set for a card scroll view style display and wanted to add iAD to the same view controller:

how can i do that without getting the errors i am getting?

this is the code for card scroll view in view controller.h

@interface ViewController1 : UIViewController <CardScrollViewDelegate> 
@end

this is my code for iAD for view controller.h but should be merged with the above otherwise i get another error saying duplicate definition:

@interface ViewController1 : UIViewController <ADBannerViewDelegate> {

    SLComposeViewController *mySLComposeSheet;
}
@property (weak, nonatomic) IBOutlet ADBannerView *banner1;

The view controller name / custom class im trying to add them both to is ViewController1

UPDATE:

its much simpler than i thought, just add a comma (FOR THOSE WHO ARE CURIOUS LIKE I WAS)

@interface ViewController1 : UIViewController <CardScrollViewDelegate, ADBannerViewDelegate> {
}

@property (weak, nonatomic) IBOutlet ADBannerView *banner1;

@end

user2721311
  • 21
  • 1
  • 5

1 Answers1

0

Your code and/or question is ambiguious. I see 3 view controllers and 2 delegates. Eitherway...which viewcontroller are you trying to add it to? Whichever one it is. Inside the implementation file should be the following:

Remember to import iAd and your code should look like this:

#import <iAd/iAd.h>;

@interface ViewController1 : UIViewController <ADBannerViewDelegate>
{
      ADBannerView *banner1;


BOOL bannerIsVisible;

}

@property (nonatomic,assign) BOOL bannerIsVisible;

Then, in viewDidLoad you can load it in a frame etc...

INSITE MOBILE
  • 133
  • 1
  • 10
  • no its not complicated at all or ambigious... and theres only one view controller which is ViewController1. i am just trying to add iAD to the card scroll view definition. if i try to add iAD as a separate definition then i get a duplicate definition error. Do you get what i mean ? its like having scroll view and iAD in the same view controller PLUS i already know the codes for both (and they work when used in different view controllers) but wondering how to merge them both together in the same view controller (ViewController1) without getting the errors – user2721311 Aug 27 '13 at 13:51
  • Are you defining the banner views as *banner1 and *banner2? – INSITE MOBILE Aug 28 '13 at 00:33