【发布时间】:2014-12-21 11:12:50
【问题描述】:
我一直在尝试将 Objective C Chartboost SDK 集成到 Swift 项目中,方法是按照他们网站上的教程进行操作,并通过使用桥接头等方式将其调整为 swift。不幸的是,当我运行初始 AppDelegate 代码时,我得到了如下截图所示的一些错误
图片链接:
然后我尝试像在 Objective C 中那样将 @ 符号放在字符串之前,这也带来了大量错误,经过大量研究后,我仍然没有真正找到解决此问题的方法,但这些是错误当我尝试按以下方式添加 @ 符号时给出。
Chartboost.startWithAppId(appId:@"appID", appSignature:@"appSig", delegate: self)
图片链接:
我还尝试了以下方法,但遇到了另一个类似的错误:
let kChartboostAppID: NSString = "123"
let kChartboostAppSignature: NSString = "123"
Chartboost.startWithAppId(appId:kChartboostAppID, appSignature:kChartboostAppSignature, delegate: self)
但这给了我以下错误(类似于第一个错误):
无法将表达式的类型“(appId: NSString, appSignature: NSString, delegate: AppDelegate)”转换为类型“(String!, appSignature: String!, delegate: ChartboostDelegate!) -> Void”
我非常感谢任何帮助,因为我已经尝试解决这个问题很长时间了:)
【问题讨论】:
标签: ios objective-c xcode swift chartboost