【发布时间】:2023-03-08 13:00:01
【问题描述】:
我刚刚找到 Chartboost,我现在正在尝试集成 SDK,但出于某种原因,在本教程的第 3 步:https://answers.chartboost.com/hc/en-us/articles/205853276-Download-Integrate-the-Chartboost-SDK-for-iOS-Swift 我收到一条错误消息:使用未解析的标识符“Chartboost”。我想我的头文件有问题,因为我认为那是我声明 Chartboost 的地方(步骤 2)。但也许它只是在错误的地方,因为他们没有说我必须把代码放在哪里,所以我只是把它放在 AppDelegate.swift 中,因为这是我知道的唯一一个具有 didFinishLaunchingWithOptions 函数的文件。那么我该如何解决这个问题呢?
头文件:
#ifndef Header_h
#define Header_h
#import <UIKit/UIKit.h>
#import <Chartboost/Chartboost.h>
#import <CommonCrypto/CommonDigest.h>
#import <AdSupport/AdSupport.h>
#endif /* Header_h */
AppDelegate:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Initialize the Chartboost library
Chartboost.startWithAppId("AppId", appSignature: "AppSignature", delegate: nil)
}
【问题讨论】:
-
用相关代码更新您的问题并显示您在哪里得到错误。
-
好吧,我现在改了
-
那是哪个头文件?是否导入到 AppDelegate.swift 中?
-
头文件是 Header.h,不,我没有将它导入 AppDelegate.swift 我该怎么做?抱歉,我的编程还不太好。
标签: ios swift chartboost