开发者

Xcode4 code completions ignores code within static library

I created a static library and a project that uses it following the instructions found at http://www.sodeso.nl/?p=822. So far it w开发者_如何学JAVAorks fine, with a “minor” exception: the code completion ignores all code in the library. So, if I start typing a method of a class inside the static library I get no code completion suggestions.

Is there any way to fix this?


I fixed this problem by specifying the full Header Search Path for my libraries in the main project settings. For example, replace:

Libraries/TestLib/

with

$(SOURCE_ROOT)/Libraries/TestLib/

I originally found the answer here.

Edit: It turns out the above solution only fixes part of the problem. As found in another question here, it turns out that there is also an issue with Xcode that is resolved in version 4.1. I'm using Xcode 4.2 beta and can confirm that the issue is fixed for me.


I've been wondering why I get code completion for certain things, and not others. It seems:

  • Static libraries: NO
  • Frameworks: YES

So if you package your static library as a framework, you should get code completion.


In my case I just readded all in "Header Search Path", so:

  1. Remove all values in "Header Search Path"
  2. Compile (probably it will fail)
  3. Then add values again

In my case after this actions I enabled code completion again

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜