我正在使用 Xamarin.IOS 开发我的第一个真正的应用程序。大多数情况下,该应用程序运行良好,但每天有几次崩溃并出现以下堆栈跟踪:
mono-rt: Stacktrace:
mono-rt: at <unknown> <0xffffffff>
mono-rt: at (wrapper managed-to-native) MonoTouch.Foundation.NSObject.monotouch_release_managed_ref (intptr) <IL 0x00023, 0xffffffff>
mono-rt: at MonoTouch.Foundation.NSObject.ReleaseManagedRef () [0x00000] in /Developer/MonoTouch/Source/monotouch/src/Foundation/NSObject.cs:98
mono-rt: at MonoTouch.Foundation.NSObject/NSObject_Disposer.Drain (MonoTouch.Foundation.NSObject) [0x00062] in /Developer/MonoTouch/Source/monotouch/src/shared/Foundation/NSObject2.cs:545
mono-rt: at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
mono-rt: at <unknown> <0xffffffff>
mono-rt: at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x0009f, 0xffffffff>
mono-rt: at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
mono-rt: at Diet52App.Application.Main (string[]) [0x00008] in /Users/danielnordmark/Projects/Diet52App/Diet52App/Main.cs:16
mono-rt: at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
mono-rt:
Native stacktrace:
mono-rt:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
我的猜测是某些对象在我尝试使用它之前会被垃圾收集。但是我对如何找出我的代码中发生这种情况的时间和地点感到有点迷茫。
我怎样才能发现问题出在哪里?任何帮助深表感谢!