Find method references in Xcode

前端 未结 6 842
抹茶落季
抹茶落季 2020-11-30 18:24

Is there a way in Xcode to find all the places where a method or property has been been called?

In Eclipse, for example, you can right-click a method and select

6条回答
  •  时光说笑
    2020-11-30 19:11

    Place the insertion point in a method invocation or declaration and choose Find > Find Selected Symbol In Project. For multipart selectors this will only highlight the first part but searching does seem to work relatively reliably. You can also use Find Call Hierarchy which highlights the entire line instead.

    The corresponding contextual menu item (Find Selected Symbol in Workspace) also works, but it's a bit trickier to make work properly. Make sure no text gets selected otherwise it'll search for the selected word rather than the entire selector. To do so, you can click with the left mouse button prior to clicking with the right mouse button (or Control-clicking) in the same location. There's no such issue with the contextual Find Call Hierarchy.

提交回复
热议问题