2016-05-13 41 views
2

我剛剛找到了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函數的唯一文件。那麼我該如何解決這個問題?如何在Swift SpriteKit中集成Chartboost SDK?

頭文件

#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) 

    } 
+0

使用相關代碼更新您的問題,並顯示出現錯誤的位置。 – rmaddy

+0

好吧我現在改了它 –

+0

哪個頭文件是那個?它是否被導入到AppDelegate.swift中? – rmaddy

回答

0

我有同樣的問題,以下是我固定它。

檢查下斯威夫特編譯器生成設置 - 代碼生成你有Objective-C的橋接報頭的位置設置爲正確路徑(AppName的/ headername.h)

而且還生成設置下 - 包裝,集定義模塊爲是。

CMD + B,現在您可以繼續執行第3步而不會收到無法解析的標識符問題。

這應該修復未解決的標識符。