8

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?

thebiglebowski11
  • 1,451
  • 10
  • 41
  • 76

3 Answers3

4

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.
jithinroy
  • 1,885
  • 1
  • 16
  • 23
  • for pointing out that UIButton was covered by an clear UIView – amleszk Aug 31 '15 at 03:22
  • 3
    In my case, View > Interaction - User Interaction Enabled was unchecked for my UIButton. This button was copied over from another View, probably the copy/paste could have disabled "User Interaction Enabled", just guessing. – mbenegas Nov 06 '15 at 18:47
0

Add the UIButton instance(in your case UIView which contains the UIButton) on top of the UIScrollView.

damithH
  • 5,148
  • 2
  • 27
  • 31
0

Turns out it was a problem with xCode... I updated and the problem went away.

thebiglebowski11
  • 1,451
  • 10
  • 41
  • 76