If I understand correctly, you want to set a breakpoint at - [UIView setFrame:], but only stop it when the "I" is an object of the SomeClass class. You can do this with a breakpoint condition. Something like:
(int) strcmp("SomeClass", (const char *)class_getName((id)[(id) $arg1 class])) == 0
The only trick is that $arg1 is an alias for the register that contains the first argument, and in ObjC methods the first argument is always self . Note that the register alias $ arg1 is defined only for architectures that use registers to pass arguments; in particular, 32-bit x86 does not pass arguments this way. The following answer provides a good description of how to get the first argument for most common architectures:
Symbolic breakpoint when calling dispatch_async with a specific queue
This may slow down the process a bit, as it will stop every time you call [UIView setFrame] , but there is no better way to avoid this, except that you suggest overriding setFrame: then stop it.
I also a little disgustingly outsmarted the casting here. We do not have debugging information for many of these functions, so you must tell the debugger what their return types are.
By the way, the lldb command line also has a type of "break on selector", which will break in all implementations of this selector. There is no UI ability to call this, but in the console you can do:
(lldb) break set -S setFrame:
So, you can set a breakpoint for all setFrame: methods, and then add the same condition (you can do this by passing the -c flag to the break set command. If this breakpoint corresponds to too many functions, you can disable individual hits by looking at their indices with the break list and then disabling them one by one using the bkpt.loc form, which you will see in the break list output.
Jim ingham
source share