Cannot get button to call iPhone 4 controller code

I my Viewhave a button myButtonin my XIB. In XIB, the owner of the file has a class HelloWorldViewController. And the view for File Owner is mine Viewin XIB.

In HelloWorldViewController(which is in MainWindow.XIB) I have - (IBAction) doMyButton:(id)senderand I have the corresponding definition in the file HelloWorldViewController.h.

In my view, I have events (again in XIB). Click Inside → File Owner doMyButton.
For the file owner, I received the actions doMyButton → Rounded Rect Button Touch Up Inside.

I have a debug point in the first line of code that is inside the doMyButton method. When I touch the button (using the mouse in the simulator), I did not hit the breakpoint.

WTF?

IB screen capture if this helps:
Overview of
Button Properties

+3
source share
3 answers

Thanks to the employee, I found out what the problem is. The view that I had with the button was in my HelloWorldViewController.xib, as intended. However, I had a drug that considered Main.xib as the main view for the NavController that I had. I edited the view in HelloWorldViewController.xib when I had to edit (read: make connections) in Main.xib where the view was duplicated for NavController.

I assumed that NavController simply points to another XIB where my original view was defined, and not with a copy of it. The view is messed up for a new perspective.

0

, , , cmd + R, cmd + y cmd + enter. cmd + r .

+1

- IBOutlet?

( , XIB ), , File Owner , . , , .

. , , , .

0

All Articles