Monday, April 6, 2015

Xcode Searching

Daniel Jalkut:

A search scope that includes system frameworks will not actually search or match against any of the frameworks that are linked to by the targets in a workspace. It appears that it will only search frameworks that are explicitly included as file references in the project navigator.

[…]

A related problem is that even if a framework is explicitly linked to, such as Cocoa.framework, only the header files of that specific framework will be searched, not the header files of subsidiary frameworks (e.g. Foundation and AppKit).

I find that searching in Xcode is only worthwhile for my own code. If I’m trying to find an API, Xcode’s documentation search is clunky and doesn’t seem to actually search all the documentation. Its header searching, as Jalkut explains, is very limited. Dash is great for searching the documentation, but there is a lot that is not documented. If Dash can’t find what I want, I have a BBEdit saved search set that looks in all the header files in the current SDK.

2 Comments RSS · Twitter


I’ve found that Shift-Cmd-O (Quick Open) in Xcode can actually search the system headers fairly well. Stuff that doesn’t show up in Xcode search proper shows up nicely in quick open. Try entering something like a framework-defined enum there (NSStringCompareOptions) and watch in amazement as it takes you to the correct system header right away.


@Jaanus That does work for some symbols. It did not work for the one that prompted this post: MNT_IGNORE_OWNERSHIP.

Leave a Comment