我使用的是最新的谷歌分析與片MonoTouch的綁定米格爾在這裏有一個困難時期:https://github.com/migueldeicaza/monotouch-libs/tree/master/GoogleAnalytics谷歌anaytics綁定更新?
我猜測,該接口在不兼容的方式改變了一點,但我不知道如何診斷。在運行時,出現此錯誤:System.InvalidCastException:無法從源類型轉換爲目標類型。 在GoogleAnalytics.GANTracker.get_SharedTracker()[0x00000]中:0
看來,僅添加有兩種方法,所以我試圖將它們添加到「api.cs」 - 卻得到了一系列的編譯器錯誤的認爲沒這似乎與情況有關。
[Export ("setCustomVariableAtIndex:index:name:value:scope:error"),Internal]
bool _SetCustomVariableAtIndex(int index, string name, string value, int scope, IntPtr nsErrorPtr);
[Export ("setCustomVariableAtIndex:index:name:value:error"),Internal]
bool _SetCustomVariableAtIndex(int index, string name, string value, IntPtr nsErrorPtr);
有其他人解決這個問題,併成功地使用谷歌分析的MonoTouch的NoThumb版本?
您不應該使用-ObjC,它的中斷,而是使用-force_load $ {ProjectDir} /Google/libGoogleAnalytics.a。 – 2011-03-17 16:17:56
我更新了我的答案以反映這一點。我有我的項目與上述參數編譯爲mtouch。 – jonathanpeppers 2011-03-17 18:19:04