I have a breakpoint that looks like this
-[UITableViewCell setSelected:]
and it works, but I cannot figure out how to get the value that is being passed in.
I have tried -[UITableViewCell setSelected:(BOOL)what]
and -[UITableViewCell setSelected:what]
which do not work at all.
How can I access the parameters?
If this doesn't work, I'll have to make a DebugUITableViewCell
just to see what's going on, which is a hassle and touches a lot of code.
To do that, use a symbolic breakpoint. In the Breakpoint navigator, click the Add button (+) in the lower-left corner, and choose Symbolic Breakpoint. Enter the object and symbol in the Symbol field, using the format of the example text. The debugger pauses when the app or your code calls the symbol you specify.
Symbolic breakpoints are breakpoints that will trigger on certain conditions, like any time a certain method is called on a class. Adding a symbolic breakpoint is achieved by clicking the “+” icon at the lower left of the Breakpoint Navigator and selecting “Symbolic Breakpoint”.
What are breakpoints in Xcode? A breakpoint can be placed at a certain line of code and pauses your app during execution in order to inspect the state of your app at that point. Breakpoints can be set at any time, before and while your app is running.
When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.
If you debug your code on the device the parameters when you hit your breakpoint will consistently be in registers r0, r1, and r2. If you use po $r0
you'll see the object receiving setSelected. If you use po $r1
you'll get "no Objective-C description available" because that's the selector. Inspect $r2 to see if selected is being set to YES or NO. It's a similar story on i386, but I can't remember off hand which registers are used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With