I try to set an action for an UIBarButtonItem like I did before with a normal button:
- Select the UIBarButtonItem in storyboard.
- Right-Click and pull to my .h-file
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?