使用 mono 2.10.9 和 monomac,我编写了 ac# 类,继承了用于从 Xcode 进行 Cocoa 绑定的 NSObject。如果我的类包含使用可空值的属性,如下所示:
[Export]
public bool? IsRegistered { get; set; }
我的应用程序在启动期间以丑陋的方式崩溃(请参阅下面的崩溃报告)。主窗口甚至还没有显示。只要我改变布尔?布尔,一切正常,但我实际上想使用布尔?有什么建议么?
崩溃报告:
Process: SQAT [44677]
Path: /Users/USER/*/SQAT.app/Contents/MacOS/SQAT
Identifier: SQAT
Version: 4 (1)
Code Type: X86 (Native)
Parent Process: launchd [136]
Date/Time: 2013-01-23 15:31:51.540 +0100
OS Version: Mac OS X 10.7.5 (11G63)
Report Version: 9
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Application Specific Information:
objc[44677]: garbage collection is OFF
abort() called
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x95da69c6 __pthread_kill + 10
1 libsystem_c.dylib 0x90dc0f78 pthread_kill + 106
2 libsystem_c.dylib 0x90db1bdd abort + 167
3 libmono-2.0.dylib 0x0029eefd mono_handle_native_sigsegv + 685
4 libsystem_c.dylib 0x90e1659b _sigtramp + 43
5 ??? 0xffffffff 0 + 4294967295
6 libmono-2.0.dylib 0x002ed970 mono_runtime_posix_install_handlers + 288
7 libsystem_c.dylib 0x90db1bdd abort + 167
8 libmono-2.0.dylib 0x003ff47f monoeg_g_logv + 159
9 libmono-2.0.dylib 0x003ff4ab monoeg_assertion_message + 43
10 libmono-2.0.dylib 0x0035a4ee mono_marshal_emit_managed_wrapper + 782
11 libmono-2.0.dylib 0x0035ae50 mono_marshal_get_managed_wrapper + 752
12 libmono-2.0.dylib 0x0035b2a2 mono_delegate_to_ftnptr + 146
13 ??? 0x011bf4be 0 + 18609342
14 ??? 0x011bf45c 0 + 18609244
15 ??? 0x01203350 0 + 18887504
16 ??? 0x01203148 0 + 18886984
17 ??? 0x013340fc 0 + 20136188
18 ??? 0x011c10a8 0 + 18616488
19 ??? 0x011c090c 0 + 18614540
20 ??? 0x01205cd8 0 + 18898136
21 ??? 0x0092bfe0 0 + 9617376
22 ??? 0x0092b6dc 0 + 9615068
23 ??? 0x0092bdde 0 + 9616862
24 libmono-2.0.dylib 0x0020dca4 mono_jit_runtime_invoke + 164
25 libmono-2.0.dylib 0x003832e4 mono_runtime_invoke + 68
26 libmono-2.0.dylib 0x003893ae mono_runtime_exec_main + 238
27 libmono-2.0.dylib 0x002735fd mono_main + 6797
28 SQAT 0x000394bf main + 3135
29 SQAT 0x00038875 start + 53