2014-11-03 72 views
1

我想指出的是,自我是一个WelcomeViewController,它从UIViewController的继承:“self.canDisplayBannerAds = YES;”使应用程序在iOS 8上崩溃?

WelcomeViewController.h

#import <UIKit/UIKit.h> 

@interface WelcomeViewController : UIViewController 
@property (strong, nonatomic) NSString* score; 
@property (strong, nonatomic) NSUserDefaults* preferences; 


@end 

WelcomeViewController.m

#import "WelcomeViewController.h" 
#import "GESceneController.h" 
#import <iAd/iAd.h> 
@interface WelcomeViewController() 
@property (weak, nonatomic) IBOutlet UILabel *scoreLabel; 
@property (weak, nonatomic) IBOutlet UILabel *highScoreLabel; 

@end 

@implementation WelcomeViewController 

- (void)viewDidLoad { 
    [super viewDidLoad]; 
    self.canDisplayBannerAds = YES; 
    [self.scoreLabel setText:self.score]; 

    NSString* highScoreText = [NSString stringWithFormat:@"Meilleur score : %ld", 
           [self.preferences integerForKey:@"highscore"]]; 

    [self.highScoreLabel setText:highScoreText]; 

    // Do any additional setup after loading the view. 
} 

和我获取错误:[WelcomeViewController setCanDisplayBannerAds:]:无法识别的选择器发送到实例0x7d97 f080

+1

你问如何解决这个问题?或者指出一个错误?或者是什么?阅读SO常见问题原因我不认为这个问题在当前时间跟随它。 – 2014-11-03 19:00:00

+0

你是对的,我编辑了主题并添加了一个问号。谢谢。 – acanterot 2014-11-04 12:20:16

回答

7

您是否已将iAd文件导入链接的框架和库?如果没有,转到你的编译信息并一直滚动到底部,在那里你会找到'链接框架',并将该框架添加到你的应用程序中。

+0

我觉得很蠢。大声笑。忘记我正在测试admob,而不是真的iAd,所以没有联系它。哈哈哈 – 2015-11-12 13:25:31