我正在将chartboost集成到我的sprite工具包游戏中,并且已经成功地将桥接文件集成到了我的快速代码中。现在,在我的应用程序委托中,我有以下内容:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let kChartboostAppID = "5554c8680d60255c6a0f4af4"
let kChartboostAppSignature = "1d0e271cd054c9a63473d2f1212ca33a2922a19f"
Chartboost.startWithAppId(kChartboostAppID, appSignature: kChartboostAppSignature, delegate: self)
Chartboost.cacheMoreApps(CBLocationHomeScreen)
return true
}
class func showChartboostAds()
{
Chartboost.showInterstitial(CBLocationHomeScreen);
}
func didFailToLoadInterstitial(location: String!, withError error: CBLoadError) {
}startWithId行给我一个错误,它不能用这些参数( String,String,AppDelegate)调用这个方法。这在我的objective c代码上运行得很好。有人知道怎么解决这个问题吗?
发布于 2015-11-22 04:54:20
class AppDelegate: UIResponder, UIApplicationDelegate, ChartboostDelegate编辑(来自下面的Lalit评论)
在startWithAppId中,委托被设置为self,因此您必须将类AppDelegate设置为委托,这可以使用以下命令完成:
ChartboostDelegate(protocol)https://stackoverflow.com/questions/30243313
复制相似问题