我想在我的项目中实施chartboost&我有一个chartboost的演示 https://github.com/ChartBoost/client-examples
我在appdelegate中添加了我的cb.appId和cb.appSignature 但是,当我运行此代码时,它显示[__NSCFDictionary setObject:forKeyedSubscript:]的错误 我已使用断点调试检查它在ExampleAppAppdelegate.m
中的此代码后显示错误 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[ExampleAppViewController alloc] initWithNibName:@"ExampleAppViewController_iPhone" bundle:nil];
} else {
self.viewController = [[ExampleAppViewController alloc] initWithNibName:@"ExampleAppViewController_iPad" bundle:nil];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
所以,在appdelegate中我应该改变什么以克服这个错误?
在appdelegate.m的项目中,我在applicationdidbecomeactive方法中添加了此代码,我已添加以下代码以包含chartboost
-(void) applicationDidBecomeActive:(UIApplication *)application
{
Chartboost *cb = [Chartboost sharedChartboost];
cb.appId=@"51c3e47d17ba475b0b000002 ";
cb.appSignature=@"392392796fb9a1603bcd2deb0aa9a17442ccd83d";
// Begin a user session. Must not be dependent on user actions or any prior network requests.
[cb startSession];
// Show an interstitial
[cb showInterstitial];
if( [navController_ visibleViewController] == director_ )
[director_ resume];
}
但仍然会出现同样的错误