objective c - iOS 7 iAd cocos2d deprecated -
I am trying to apply iOd to iOS 7 game, which I have created with Cocos 2D, I have added the IED framework in the exode and setup i
I have set up @implementation
ADBannerView * _bannerView;
Then (id) init {if ((self = [init init])) // Introduce ADBannerView a new initializer on iOS 6, Use it if available ([ADBannerView instancesRespondToSelector: @selector (initWithAdType :)) {ADBannerView * _adView = [[ADBannerView alloc] initWithAdType: ADAdTypeBanner]; } And {_adView = [[ADBannerView alloc] init]; } _adView.requiredContentSizeIdentifiers = [NSSet Set With Object: ADBannerContentSizeIdentifierPortrait]; _adView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait; [[[CCD Citizen Share Director] View] Adsview: _adView]; [_adView setbackgram color: [UIColor clearColor]]; [[[CCD Citizen Share Director] View] Adsview: _adView]; _adView.delegate = self; } [Self Layout Unwanted: Yes]; Self return; } - (zero) layoutAnimated: (BOOL) Animated {// according to iOS 6.0, the banner will automatically resize its size based on its width. // To support iOS 5.0, however, we continue to set up the current content identifier correctly. CGRect contentFrame = [CCDCD shared director] View.bounds; If (contentFrame.size.width & lt; contentFrame.size.height) {//_bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait; [AdViewSetOutroSingMask: UIViewAutoresizingFlexibleWidth]; } And {_bannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierLandscape; } CGRect bannerFrame = _bannerView.frame; If (_bannerView.bannerLoaded) {contentFrame.size.height - = _bannerView.frame.size.height; BannerFrame.origin.y = contentFrame.size.height; } And {bannerFrame.origin.y = contentFrame.size.height; } [UIView ChetanDance: Animated? 0.25: 0.0 Animation: ^ {_bannerView.frame = bannerFrame; }]; } - (Zero) Banner ViewDidLoadAd: (ADBannerView *) Banner {[Self Layout Unwrapped: Yes]; } - (zero) BannerView: (ADBannerView *) used to banner FileTorिव्हv Advith Error: (NSError *) Error [[Self Layout Unwanted: Yes]; }
I get an error about '_adview' as well as about 'currentContentSizeIdentifier', can someone help me to work properly? I am checking all day online and no code can work.
Thanks in advance!
Try this new code:
- (zero) create addbannerview {_adBannerView = [[ADBannerView alloc] initWithFrame: CGRectZero]; _adBannerView.delegate = self; [_adBannerView Setautorizing Mask: UIViewAutoresizingFlexibleWidth]; CGRect Frame = _adBannerView.frame; Frame.origin.y = -frame.size.height; Frame.origin.x = 0.0f; _adBannerView.frame = frame; AppDelegate * app = ((AppDelegate *) [UIApplication shared application] .delegate)); [Add App.navController.viewSubview: _adBannerView]; }
Comments
Post a Comment