如何查看Xcode中文件的包含位置?

时间:2014-10-21 03:54:14

标签: c++ ios xcode

我遇到了一个问题,我需要知道如何包含文件common_headers.h,因为some_implementation.cpp内可以访问各种内容。在some_implementation.cpp内,我不直接包含common_header.h。相反,我包括important_headers.hold_headers.htest_headers.h等。其中一个文件可能包含common_headers.h,但更可能是一个(或更多) )包括一个包含common_headers.h文件的文件。在Xcode中有没有办法看到这些路径?类似的东西:

?> Find-Include-Path some_implementation.cpp common_headers.h
common_headers.h is included first via:
some_implementation.cpp
  important_headers.h
    deprecated_header.h
      common_headers.h

1 个答案:

答案 0 :(得分:0)

最简单的方法是将错误引入common_headers.h。把它放在文件的顶部:

#error where am I

然后选择产品>构建(默认快捷方式:⌘B)。构建将失败。选择查看>导航器>显示问题导航器(默认快捷方式:⌘4)。打开显示三角形(选项单击将切换整个树打开/关闭)以找到完整的包含堆栈:

error include stack

在我的示例中,ViewController.m包含ViewController.h,其中包含important.h,其中包含common.h

相关问题