objective c - How to find out who called a method? -


Example: When my method is called - fooBar, I want to log in it to the console, another method Which is called the second class.

  _cmd [self class]  Now, I know how to log the name of the method of the foos and its class is:   

Is it possible to find out?

There is a fully customized code in which 100% certain methods No. The compiler can use the tail call optimization while the compiler uses the collar stack frame effectively to re-use for cali.

To see an example, set a breakpoint on any method that uses GDB and see post-tracing. Note that you do not see objc_msgSend () before each method call because the objc_msgSend () makes a tail call for the implementation of each method.

When you can customize your application to non-optimized, you will need non-optimized versions of all system libraries to avoid this one problem.

And this is just a problem; In fact, you are asking, "How do I search for crashtrates or GDB again?" A very difficult problem on which the careers are making till you do not want "debugging tools" to become a career, I would advise to go down this road.

What are you really answering?

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -