2015-09-15 70 views
0

我試圖使用答案,Crashlytics內的框架來跟蹤事件。 當我嘗試運行它時,它崩潰。答案崩潰

在頂部:

import Fabric 
import Crashlytics 

然後在應用程序委託進一步下跌:

Fabric.with([Crashlytics()]) 
Fabric.with([Answers()]) 

最後我做的:

Answers.logCustomEventWithName("test", customAttributes: ["test1":"a"]) 

而且它拋出一個異常:

[CLSAnalyticsController logCustomEvent:]: unrecognized selector sent to instance 0x7fa061d356c0 
2015-09-15 19:29:02.210 TestApp[80248:5943964] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CLSAnalyticsController logCustomEvent:]: unrecognized selector sent to instance 0x7fa061d356c0' 
*** First throw call stack: 

任何想法發生了什麼?

我嘗試刪除Crashlytics並重新安裝,並沒有運氣。這可能是Xcode/ios9問題嗎?

非常感謝!

回答

0

我認爲你應該做的:

Fabric.with([Crashlytics.sharedInstance()]) 

,而不是

Fabric.with([Crashlytics()]) 
+0

嗯感謝,但沒有運氣 – NullHypothesis

0

確保您添加didFinishLaunchingWithOptions方法裏面的面料初始化。

而且Crashlytics安裝告訴我使用包括.self()

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 

    Fabric.with([Crashlytics.self()]) 

} 
+0

是這樣做下面的初始化代碼,但仍然崩潰後,我嘗試登錄事件= / – NullHypothesis