I am trying to find out how a UIView
s transformation matrix is being modified. Thus (using the gdb
console) I'd like to watch for any/all changes of the UIView
's transform
prop开发者_Go百科erty. How would I go about doing so?
Add a symbolic breakpoint in Xcode. Use -[UIView setTransform:]
as the Symbol.
Use a more narrow subclass class if you want less or more specific output.
Use a symbolic breakpoint -[UIView setTransform:]
. Note that you can also use a condition with $arg1 (works only on 64bit simulator like iphone 5s) compared to some pointer to catch breakpoints on property change only for a specific instance $arg1 == 0x7f9cbba75e60
. Screenshot below shows a breakpoint that catches changes on transform property only for UIView instance that has a pointer 0x7f9cbba75e60
If you're like me, and don't write in Obj-C, here's a quick Swift way to do it for beginners.
Just add a didSet
to the property, and a breakpoint inside the block.
精彩评论