The debugger does not show IUKit.UIControl from sender variable

When i run the the bugger with the break point activated in badMethod () the sender variable does not have the IUKit.UIControl :frowning:… instead…

It seems like the property has been changed by baseUIControl :confused:

1 Like

I had the exact same problem, but found a fix.

In the ViewController class, make sure your @IBAction func buttonTapped {…} and func badMethod() {…} are after the two override funcs.

This wasn’t explained in the book, but just change that around and the Variables View behaves like it should. The viewDidLoad() must instantiate something that formats the Variables View before the breakpoint.

1 Like

I found that after clicking “step over”, or on subsequent runs of the app, that the issue resolved itself and the sender variable updated to contain the contents as described on page 167.

Oddly enough, if I restart Xcode and the iPhone simulator, the same issue comes up again.

1 Like

Step-over, and rerun - This worked for me.
I already had the routines in the order proposed by doge when the problem occurred.

1 Like

It’s in a different location as of Xcode 9.1 - you can see the tree here in this screenshot, with _target and what you’re really looking for when the book mentions the _selector property (the property is actually _action).

Even in the screenshot from the book on page 167, there is no “_selector” visible, only “_action”. I don’t know why they wrote it that way. The _action property has the (SEL) “buttonTapped:” next to it and is the appropriate one to look at, I believe.

After I found the location mentioned in my post above, the next run through, it showed me the UIKit.UIControl property for the first time.