我正在尝试运行在Xamarin.Mac上正常运行的Monodevelop(最新Git)a solution
它在base()
行崩溃:
public class SetupWindow : NSWindow {
public List <NSButton> Buttons = new List <NSButton> ();
public string Header;
public string Description;
private NSImage side_splash;
private NSImageView side_splash_view;
private NSTextField header_text_field;
private NSTextField description_text_field;
public SetupWindow () : base ()
{
SetFrame (new RectangleF (0, 0, 640, 420), true);
使用此输出:
2014-02-06 18:05:28.567 mono[8564:507] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error (1000) creating CGSWindow on line 263'
*** Call stack at first throw:
(
0 CoreFoundation 0x927956b1 __raiseError + 193
1 libobjc.A.dylib 0x96f38091 objc_exception_throw + 162
2 CoreFoundation 0x927955cb +[NSException raise:format:] + 139
3 AppKit 0x97f434b3 _NSCreateWindowWithOpaqueShape2 + 1718
4 AppKit 0x97f41f3a -[NSWindow _commonAwake] + 4391
5 AppKit 0x97e167fb -[NSWindow _commonInitFrame:styleMask:backing:defer:] + 864
6 AppKit 0x97e15de3 -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1090
7 AppKit 0x97e1599a -[NSWindow initWithContentRect:styleMask:backing:defer:] + 70
8 AppKit 0x9860919a -[NSWindow init] + 107
9 ??? 0x02a01d22 0x0 + 44047650
10 ??? 0x04095ebc 0x0 + 67722940
11 ??? 0x04095108 0x0 + 67719432
12 ??? 0x02a02c34 0x0 + 44051508
13 ??? 0x029fec8c 0x0 + 44035212
14 ??? 0x02296b84 0x0 + 36268932
15 ??? 0x02296e9f 0x0 + 36269727
16 mono 0x0007b2ee mono_jit_runtime_invoke + 798
17 mono 0x0023500e mono_runtime_invoke + 126
18 mono 0x002395c4 mono_runtime_exec_main + 420
19 mono 0x00239935 mono_runtime_run_main + 725
20 mono 0x000e68d5 mono_jit_exec + 149
21 mono 0x000e8f12 mono_main + 9778
22 mono 0x0006e9fe main + 558
23 mono 0x0006e7c5 start + 53
知道出了什么问题吗?
由于another problem,我注释了为NSApplication.SharedApplication.ApplicationIconImage
和NSWorkspace.SharedWorkspace.SetIconforFile
设置图片的行,这可能是问题吗?
一位同事试用了他全新的Mac,并得到了完全相同的问题。
答案 0 :(得分:0)
通过在实例化SetupWindow
之前添加这两行来解决问题:
NSApplication.SharedApplication.ApplicationIconImage = image;
SetFolderIcon ();
现在应用程序运行良好。