我目前正在向我的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 :(得分:0)
你有一组额外的括号。替换这个:
[[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleModuleFail) name:@"onModuleFailed" object:@"AppFireworksNotification"]];
有了这个:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleModuleFail) name:@"onModuleFailed" object:@"AppFireworksNotification"];