Say I have a variable, self.position
, how do I get Xcode to break whenever it changes its value (a number of methods could change it).
For conditional breaking:
For breaking on every occasion the value has changed:
If you want to see who invoked the setter - just look at the next line in the stack trace (viewDidLoad in my example):
Update:
Adding a watchpoint
(lldb)
prompt shows up in the consolewatchpoint set variable _position
(replace _position with an iVar you want to watch)watchpoint modify -c "_position < 0.5" 1
where the expression in quotes is the condition and the number at the end is the watchpoint number you noted in #3.