在Xcode 4中,设置用户标题搜索路径会破坏代码感 [英] In Xcode 4, setting User Header Search path breaks code sense

查看:62
本文介绍了在Xcode 4中,设置用户标题搜索路径会破坏代码感的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要的设置是一个主项目,它取决于子项目(生成静态库)。将子项目添加到Xcode工作正常,但正如您所期望的那样,您必须将用户标题搜索路径设置为包含子项目的文件夹,除非您要明确地将子项目的文件添加到主项目中,这样做会失败的目的。子项目。

My desired setup is a main project, which depends on a subproject (which generates a static library). Adding the subproject to Xcode works fine, but as you'd expect you have to set the User Header Search path to include the subproject's folder, unless you want to add the subproject's files to the main project explicitly, which sort of defeats the purpose of the subproject.

从我所知,设置用户头搜索路径将破坏代码意义和主项目中的跳转到定义导航,下次打开该项目。

From what I can tell, setting the User Header Search path will break code sense and "jump to definition" navigation in the main project, next time your open the project.

这是一个示例,超级简单的股票项目,用于说明问题:

Here's a sample, super simple, stock project that illustrates the problem:

http://dl.dropbox.com/u/579169/MainProject.zip

如果您转到Application Delegate并尝试跳转到属性引用的定义,比如说self.window,Xcode只会给出一个它知道的所有窗口属性的列表关于。同样,自动完成无法工作。

If you go to the Application Delegate and try to jump to definition on a property reference, say self.window, Xcode simply gives you a list of all the "window" properties it knows about. Likewise, autocomplete fails to work.

如果删除用户标题搜索路径,关闭项目并重新打开它,代码检测将按预期工作。

If you delete the user header search path, close the project and reopen it, code sense works as expected.

我已经向Apple提交了一个错误,但是想知道是否有人遇到过这个特定问题,或者有一个合理的解决方法。删除项目derived构建文件夹以触发reindex不能可靠地工作。

I've filed a bug with Apple, but was wondering if anyone has run into this specific problem, or has a reasonable workaround. Deleting the project "derived" build folder to trigger a reindex doesn't work reliably.

推荐答案

解决方法是制作标头在静态库中公开。然后将以下内容添加到用户标题搜索路径

A work around is to make the headers public in the static library. Then add the following to user header search paths

"${BUILT_PRODUCTS_DIR}/usr/local/include/"

这篇关于在Xcode 4中,设置用户标题搜索路径会破坏代码感的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆