Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IBAction not being called [closed]

I am building an app with interface builder for the iPad. The scroll view takes up most of the screen except for a small portion at the bottom. Scrolling is enabled downwards. In the small portion on the bottom (not inside the scrollview), there is a UIButton that is connected to an IBAction:

- (IBAction)submit:(id)sender; 

And implemented as follows:

- (IBAction)submit:(id)sender
{
    NSLog(@"submit called");
}

I have connected up IBActions to buttons in IB countless times and never had a problem... But for some reason this is not getting called. I hooked it up by selecting the Button->connections inspector -> touch up inside -> files owner -> submit... Has anyone had this problem?

like image 268
thebiglebowski11 Avatar asked Nov 08 '12 04:11

thebiglebowski11


People also ask

What does IBAction mean?

“IBAction” is used by in place of the “return type” void for a method that receives an event sent from Interface Builder. The IBAction keyword allows the programmer to connect the source code to user interface objects in Interface Builder.

What is the difference between IBOutlet and IBAction?

An IBOutlet is for hooking up a property to a view when designing your XIB. An IBAction is for hooking a method (action) up to a view when designing your XIB. An IBOutlet lets you reference the view from your controller code.

What is@ IBAction in Swift?

@IBAction is similar to @IBOutlet , but goes the other way: @IBOutlet is a way of connecting code to storyboard layouts, and @IBAction is a way of making storyboard layouts trigger code. This method takes one parameter, called sender . It's of type UIButton because we know that's what will be calling the method.

What is IBAction Objective C?

IBAction – a special method triggered by user-interface objects. Interface Builder recognizes them. @interface Controller { IBOutlet id textField; // links to TextField UI object } - (IBAction)doAction:(id)sender; // e.g. called when button pushed.


1 Answers

Check Whether:

  1. the owner name is correct and the touchup inside is set to the correct owner.
  2. the button is getting the touch event and not covered by scrollview.
  3. you are using any custom button, if yes check its implementation to see whether the touch is handled there.
like image 188
jithinroy Avatar answered Oct 21 '22 20:10

jithinroy