0

I am currently implementing LeadBolt interstitial ads into my iOS app. However, at the end of this line:

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

I am getting an "expected identifier" error. Please advise on how this can be resolved.

-(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];
rebello95
  • 8,486
  • 5
  • 44
  • 65
user3440354
  • 3
  • 1
  • 4

1 Answers1

0

You have an extra set of brackets. Replace this:

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

With this:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleModuleFail) name:@"onModuleFailed" object:@"AppFireworksNotification"];
rebello95
  • 8,486
  • 5
  • 44
  • 65
  • That worked... Although,when I run my app and go to the viewDidLoad where this ad is the app crashes and it says in green: thread 1: signal SIGABRT... any ideaa what that is? sorry, new to xcode – user3440354 Aug 27 '14 at 18:28
  • You should add an [exception breakpoint](http://stackoverflow.com/a/17802723/1145804), that will give you more info. That question should be posted separately though since it's not the same question as this. Please accept my answer if you can. – rebello95 Aug 27 '14 at 18:30
  • Just click the checkmark under the up/down arrows next to the answer. It helps to identify the correct answer to future developers who may have the same problem. – rebello95 Aug 27 '14 at 18:34