I try to set an action for an UIBarButtonItem like I did before with a normal button:
Change to action and choose UIBarButtonItem and give the action a name.
- (IBAction)haupt:(UIBarButtonItem *)sender;
Write some code in the function at my .m-file.
- (IBAction)haupt:(UIBarButtonItem *)sender {
NSLog(@"button");
}
Now I try this in the simulator, but nothing happens (No output on the console). What I am doing wrong?
Select the UIBarButton , Create an IBAction by CNRL+Dragging at the implementation section in .m file then try to print with NSLog use breakpoint to know if the control is reaching the IBAction you created.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With