0

我想在我的项目中实现 chartboost 并且我有一个来自 https://github.com/ChartBoost/client-examples的 chartboost 演示

我已经在 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.mi 项目中,我在 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];
}

但它仍然给出同样的错误

4

0 回答 0