Forum Xamarin.Mac

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

xamarin.mac - NSAlert crashes the mac app.

I am developing the desktop app for mac using xamarin but app is crashes because of below code:

NSAlert alert = new NSAlert();
alert.MessageText = string.Format("Are you sure you want to delete the style collection: {0} v{1}?", sc.Name, sc.Version);
alert.AddButton("Delete");
alert.AddButton("Cancel");
alert.AlertStyle = NSAlertStyle.Critical;

                bool bDelete = alert.RunModal() != 1001;
                alert.DangerousRelease();

and below is the app crash logs:

=================================================================

Native Crash Reporting

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.

=================================================================

Native stacktrace:

 (No frames) 

=================================================================

Basic Fault Address Reporting

Memory around native instruction pointer (0x7fff6f87165d):0x7fff6f87164d 49 ba f8 ff ff ff ff 7f 00 00 4c 23 17 49 89 f3 I.........L#.I..
0x7fff6f87165d 45 23 5a 18 49 c1 e3 04 4d 03 5a 10 49 3b 33 75 E#Z.I...M.Z.I;3u
0x7fff6f87166d 0a 4d 8b 5b 08 4d 31 d3 41 ff e3 49 83 3b 01 76 .M.[.M1.A..I.;.v
0x7fff6f87167d 13 49 83 c3 10 49 3b 33 75 f1 4d 8b 5b 08 4d 31 .I...I;3u.M.[.M1

=================================================================

Managed Stacktrace:

  at <unknown> <0xffffffff>
  at Foundation.NSObject:xamarin_release_managed_ref <0x0008d>
  at Foundation.NSObject:ReleaseManagedRef <0x00022>
  at NSObject_Disposer:Drain <0x0018a>
  at <Module>:runtime_invoke_void_object <0x000f0>
  at <unknown> <0xffffffff>
  at AppKit.NSApplication:NSApplicationMain <0x00164>
  at AppKit.NSApplication:Main <0x000f2>
  at StyleGuard.MainClass:Main <0x00032>

at :runtime_invoke_void_object <0x000f0>

I am not able to find the cause of app crash if anyone know please help.

Thanks
Pooja.

Sign In or Register to comment.