2013-03-19 11 views
6

मेरी कोडrequiredContentSizeIdentifiers बहिष्कृत है

-(void)viewDidLoad 
{ 
    adView = [[ADBannerView alloc] initWithFrame:CGRectZero]; 
    adView.frame = CGRectOffset(adView.frame, 0, -50); 
    adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait]; 
    adView.currentContentSizeIdentifier =ADBannerContentSizeIdentifierPortrait; 
    [self.view addSubview:adView]; 
    adView.delegate=self; 
    self.bannerIsVisible=NO; 

    [super viewDidLoad]; 

} 

//when banner is loaded successfully 
- (void)bannerViewDidLoadAd:(ADBannerView *)banner 
{ 
    if (!self.bannerIsVisible) 
    { 
     [UIView beginAnimations:@"animateAdBannerOn" context:NULL]; 
     // banner is invisible now and moved out of the screen on 50 px 
     banner.frame = CGRectOffset(banner.frame, 0, 50); 
     [UIView commitAnimations]; 
     self.bannerIsVisible = YES; 
    } 
} 

//when any problems occured 
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error 
{ 
    if (self.bannerIsVisible) 
    { 
     [UIView beginAnimations:@"animateAdBannerOff" context:NULL]; 
     // banner is visible and we move it out of the screen, due to connection issue 
     banner.frame = CGRectOffset(banner.frame, 0, -50); 
     [UIView commitAnimations]; 
     self.bannerIsVisible = NO; 
    } 
} 

कोड

currentContentSizeIdentifier 

requiredContentSizeIdentifiers 

ADBannerContentSizeIdentifierPortrait 

पदावनत किया गया है, तो क्या मैं इसके साथ, स्थान लेते हैं तो यह अभी भी काम करेगा?

मुझे इसे सबमिट करने से पहले मुझे ऐसा करने की ज़रूरत है, क्योंकि यदि नहीं, तो ऐप खारिज कर दिया जाएगा।

कृपया मुझे अग्रिम

+0

तुमने कहा था तो उसे एक डुप्लीकेट सवाल है, लेकिन मेरे सवाल का – user2167312

उत्तर

12

में मदद

धन्यवाद आप कोड का उल्लंघन करने वाली लाइनों को हटाने और नीचे एक लागू करते हैं तो यह एक ही परिणाम प्राप्त होगा, लेकिन यह पदावनत नहीं है।

निकालें:

adView.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait]; 
adView.currentContentSizeIdentifier =ADBannerContentSizeIdentifierPortrait; 

जोड़ें:

[adView setAutoresizingMask:UIViewAutoresizingFlexibleWidth]; 
+0

यह जवाब नहीं प्राप्त करता है वास्तव में इस मुद्दे को हल नहीं है। यदि आपने कोड की उन पंक्तियों को हटा दिया है और कुछ भी नहीं जोड़ा है तो आपका कोड अभी भी काम करेगा। यह 'आवश्यक सामग्री नहीं है IDententiers' के लिए वास्तविक प्रतिस्थापन नहीं है, यदि आपने उन्हें परिदृश्य पर सेट किया है, पोर्ट्रेट नहीं है, और उपरोक्त कोड के साथ कोड को बदलने का प्रयास किया है, तो आप देखेंगे कि आपका ऐप तोड़ना शुरू हो गया है। –

0

IOS 6 कई नए अपडेट के साथ आता है। इतने सारे ऑटोरेसीज नियंत्रण बहिष्कृत हैं। ADBannerContentSizeIdentifierPortrait भी बहिष्कृत है।

यहां लिंक है जो आपको इस समस्या को हल करने में मदद करेगा।

autolayout example

संबंधित मुद्दे