我有一个非常基本的应用程序,用于测试第 3 方库绑定(bind)。我通过界面生成器创建了一个 IBAction。当我单击连接到 IBAction 的按钮时,我的应用程序崩溃了。这只发生在 Debug模式下。该应用程序在 Release模式下或在我的设备上运行时不会崩溃。崩溃甚至发生在任何 IBAction 方法被调用之前。
这是在控制台上记录的错误:
2014-09-12 08:38:45.293 VinScanSandBox[33818:70b] instance: <CSSNMobileSDKController: 0x7a6a8a30>
mono-rt: Stacktrace:
mono-rt: at <unknown> <0xffffffff>
mono-rt: at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x000a6, 0xffffffff>
mono-rt: at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:39
mono-rt: at VinScanSandBox.Application.Main (string[]) [0x00008] in /Users/scordova/Projects/VinScanSandBox/VinScanSandBox/Main.cs:17
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.
=================================================================
更新:取消选中“启用调试”修复了崩溃,但没有向我解释为什么它首先发生。仍在寻找完整的解决方案。
最佳答案
如果您在您的应用中使用 ListView ,请尝试添加 ListView 的以下属性 ListView 缓存策略="回收元素
在所有 ListView 的 .xaml 文件中
关于c# - Xamarin App 仅在 Debug模式下崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25809724/