IBAction UIButton and EXC_BAD_ACCESS

I write in a .h file

-(IBAction)openShuffleForm; 

and .m

 -(IBAction)openShuffleForm{ NSLog(@"XXXXXXX"); } 

and connect with but when I run my program, this error message shows this message

-[UITouchData openShuffleForm]: unrecognized selector sent to instance 0x391cc20

** What happened, I don’t know why?

0
source share
2 answers

Have you created a link between the button and the implementation? The implementation class must have an IBOutlet of type UIButton. Bind IBOutlet to the button in the interface builder. This will cause the button to be automatically created when rendering the view and BAD ACCESS should be reduced.

0
source

In my case, it was a modal window that I released after opening. Thus, any button that I pressed to try to call ANY IBAction will not work from this Modal View and kill the application with SIGBART or BAD_EXEC errors.

0
source

Source: https://habr.com/ru/post/1394280/


All Articles