IBAction not being called

thebiglebowski11 picture thebiglebowski11 · Nov 8, 2012 · Viewed 10.4k times · Source

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?

Answer

jithinroy picture jithinroy · Nov 8, 2012

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.