Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7674111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:39:59+00:00 2026-05-31T16:39:59+00:00

The Code: UIButton rightButton = UIButton.FromType (UIButtonType.DetailDisclosure); rightButton.TouchUpInside += (o, e) => { Console.WriteLine(hello);

  • 0

The Code:

UIButton rightButton = UIButton.FromType (UIButtonType.DetailDisclosure);

rightButton.TouchUpInside += (o, e) => { Console.WriteLine("hello"); };

Stacktrace:

…

Native stacktrace:

0   taggr                               0x000908fc mono_handle_native_sigsegv + 284
1   taggr                               0x00005c98 mono_sigsegv_signal_handler + 248
2   libsystem_c.dylib                   0x95c2859b _sigtramp + 43
3   ???                                 0xffffffff 0x0 + 4294967295
4   UIKit                               0x0219355a -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
5   UIKit                               0x02238b76 -[UIControl sendAction:to:forEvent:] + 66
6   UIKit                               0x0223903f -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 503
7   UIKit                               0x022382fe -[UIControl touchesEnded:withEvent:] + 549
8   UIKit                               0x021b8a30 -[UIWindow _sendTouchesForEvent:] + 513
9   UIKit                               0x021b8c56 -[UIWindow sendEvent:] + 273
10  UIKit                               0x0219f384 -[UIApplication sendEvent:] + 464
11  UIKit                               0x02192aa9 _UIApplicationHandleEvent + 8196
12  GraphicsServices                    0x0478afa9 PurpleEventCallback + 1274
13  CoreFoundation                      0x011951c5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
14  CoreFoundation                      0x010fa022 __CFRunLoopDoSource1 + 146
15  CoreFoundation                      0x010f890a __CFRunLoopRun + 2218
16  CoreFoundation                      0x010f7db4 CFRunLoopRunSpecific + 212
17  CoreFoundation                      0x010f7ccb CFRunLoopRunInMode + 123
18  GraphicsServices                    0x04789879 GSEventRunModal + 207
19  GraphicsServices                    0x0478993e GSEventRun + 114
20  UIKit                               0x02190a9b UIApplicationMain + 1175
21  ???                                 0x09ff8784 0x0 + 167741316
22  ???                                 0x09ff79d0 0x0 + 167737808
23  ???                                 0x09ff7878 0x0 + 167737464
24  ???                                 0x09ff7907 0x0 + 167737607
25  taggr                               0x0000a002 mono_jit_runtime_invoke + 722
26  taggr                               0x00169efe mono_runtime_invoke + 126
27  taggr                               0x0016dfe4 mono_runtime_exec_main + 420
28  taggr                               0x00173405 mono_runtime_run_main + 725
29  taggr                               0x00067205 mono_jit_exec + 149
30  taggr                               0x002116d5 main + 2837
31  taggr                               0x00003055 start + 53

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:40:00+00:00Added an answer on May 31, 2026 at 4:40 pm

    That code is both right and wrong depending on it’s context. Let’s assume it’s wrong (with the stack trace) because it’s used like:

    void BadCase ()
    {
        UIButton rightButton = UIButton.FromType (UIButtonType.DetailDisclosure);
        rightButton.TouchUpInside += (o, e) => { Console.WriteLine("hello"); };
    }
    

    In this case rightButton can be collected (by the garbage collector) once the method returns (since there’s no managed reference to the local variable). However the native button can still exists and will try to call back (into managed code) when a touch event occurs. This will lead to a crash (since the managed instance was collected).

    UIButton rightButton;
    
    void GoodCase ()
    {
        rightButton = UIButton.FromType (UIButtonType.DetailDisclosure);
        rightButton.TouchUpInside += (o, e) => { Console.WriteLine("hello"); };
    }
    

    You can easily avoid this by keeping a reference to the button, e.g. by promoting it from a local variable to a field. That will prevent the GC to collect the managed button until the instance (of the type) is disposed. This means the native button will be able to call back into managed land and output your hello.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to set the title of a UIButton via code. I find myself
how to make a UIButton when moving (animated) without shadow? i tried the code
I have the following code: self.shareButton=[[UIButton alloc] initWithFrame:CGRectMake(0.0, 0.0, 35, 35)]; [shareButton setBackgroundColor:[UIColor blueColor]];
The following is code that I use to add a UIButton to a layer
Whats wrong with the following piece of code: UIButton *button = [[UIButton alloc]init]; CGRect
I add button in UITableView cell. My code is UIButton *btnView = [[UIButton buttonWithType:UIButtonTypeContactAdd]
I have the following code -(void) animate:(UIButton*) b withState: (int) state andLastState:(int) last_state {
How do you set the image for a UIButton in code? I have this:
So, I have this code UIButton *accessoryButton = [[UIButton alloc] init]; UIImage *accImage =
I have a query on this. Please look at the sample code below: UIButton

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.