You can easily set a watchpoint in XCode by following these steps (btw if there is a simpler way, I\'d like to know it...):
- Run your program
- Set a breakpoint i
Watchpoint is just like a breakpoint which gets hit when the value of a variable which is being watched gets updated. To set it please follow below steps:
1.Set a breakpoint such that the variables view in the debugger shows the variable you want to watch. 2.Right click on the variable and select Watch "variable name". 3.This will stop the execution whenever the value of the variable changes.
The watchpoint will now start showing in the debug navigator. In order to remove it just drag is towards the editor and you are good to go.
PS : this is just a smarter version of implemention didset for a variable and setting and breakpoint inside it.