How do I navigate through a method call hierarchy in Xcode 4?

帅比萌擦擦* 提交于 2019-12-22 01:52:07

问题


I come from Eclipse, I would like to know if there is a way in Xcode 4 to navigate through method calls like there. I know I can jump to the definition of a method, but I want to know who is calling that method/function. The only way I've found is doing a regular text search, but that's not very helpful.


回答1:


Since Xcode 4.4 the feature to look up the immediate caller and/or callees of a method has been available. Unfortunately, there doesn't seem to be a handy hierarchy view as there is in Eclipse.

What's New in Xcode 4.4

Xcode can show the callers and callees of the current function or method. This function is accessed from the Show Related Items menu, or by using the Assistant editor and selecting Callers or Callees in the jump bar pop-up menu.




回答2:


here is a visual how to find the caller(s). Look for the little image i've highlighted in pink.




回答3:


Doing a search is indeed the only way to check where in the code certain messages are being sent. Xcode doesn't have such a functionality. Keep in mind that even if it had, it couldn't be perfect because messages can be composed and sent dynamically at runtime.



来源:https://stackoverflow.com/questions/8026824/how-do-i-navigate-through-a-method-call-hierarchy-in-xcode-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!