views:

38

answers:

1

I've got a simple question but it has got me confounded. The code below gets an UNDEFINED error for UIControlTouchUpInside. What do I need to include or import? If I comment out the line, it works. So that means forState:UIControlStateNormal is defined. I'm new so hope you can help.

UIButton * button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setTitle:@"Accept?" forState:UIControlStateNormal];
[button addTarget:self action:@selector(acceptTapped) forControlEvents:UIControlTouchUpInside];
+4  A: 

You don't need to import anything. You need only consult the documentation, where you will find that the symbol you're looking for is UIControlEventTouchUpInside. You could also just type "UIControl" in XCode and hit escape. UIControlEventTouchUpInside will be in the list that pops up.

Felixyz