2014-08-27 59 views
0

我目前正在將LeadBolt插頁式廣告實施到我的iOS應用中。但是,在該行末尾:實施Leadbolt廣告時的預期標識符錯誤

[[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleModuleFail) name:@"onModuleFailed" object:@"AppFireworksNotification"]]; 

我收到「預期標識符」錯誤。請告知如何解決這個問題。

-(void)loadDisplayAd 
{ 
    LeadboltOverlay *interstitial = [LeadboltOverlay createAdWithSectionid:@"YOUR_LB_INTERSTITIAL_ID" view:self.view]; 
    [interstitial loadAd]; 
} 


- (void)viewDidLoad { 

    LeadboltOverlay *audioad = [LeadboltOverlay createAdWithSectionid:@"YOUR_LB_AUDIO_ID" view:self.view]; 
    [audioad loadAudioAd]; 
    // [AppTracker setLandscapeMode:YES]; // Un-comment for Landscape mode 
    [[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleModuleFail) name:@"onModuleFailed" object:@"AppFireworksNotification"]]; 
    [AppTracker startSession:@"APPFIREWORKS_API_KEY" view:self.view]; 


    [self loadDisplayAd]; 

回答

0

您有一組額外的括號。有了這個

[[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleModuleFail) name:@"onModuleFailed" object:@"AppFireworksNotification"]]; 

:替換此

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleModuleFail) name:@"onModuleFailed" object:@"AppFireworksNotification"]; 
+0

這工作......雖然,當我運行我的應用程序,並轉到viewDidLoad中展示此廣告是應用程序崩潰,它在格林說:螺紋1:信號SIGABRT ...任何想法是什麼?對不起,新的xcode – user3440354 2014-08-27 18:28:12

+0

你應該添加一個[例外斷點](http://stackoverflow.com/a/17802723/1145804),這會給你更多的信息。這個問題應該單獨公佈,因爲它不是這個問題。如果可以,請接受我的答案。 – rebello95 2014-08-27 18:30:29

+0

我該如何接受你的回答 – user3440354 2014-08-27 18:32:44