我想使用 Xcode 4 和 Cocoa Touch 静态库项目管理工作区中的项目,这些项目包含我可以从其他项目引用的共享代码.根据 WWDC 2010 视频和 Xcode 4 文档,Xcode 4 中的工作区有一个隐式依赖"功能.我一直在努力让它工作,但我没有取得太大的成功.
示例工作区:
似乎开发人员正在回退到旧技术,而不是真正使用新的隐式依赖"功能.
如果我能帮助我理解如何在 Xcode 4 中使用隐式依赖项"来处理工作区,我将不胜感激.
这是我的问题:
我刚刚花了两天时间构建和重建我们的项目,就在这个问题上苦苦挣扎.虽然我现在有一个可以正确构建和链接的项目并且有工作的代码感知,但我对其中一个步骤并不 100% 满意,因为它似乎有点 hack 并且肯定不符合我的自动隐式依赖项"的概念.
FWIW 这是我采取的步骤:
我真的不喜欢第 8 步和第 9 步.这真的感觉 XCode 并没有像广告宣传的那样做.但是,如果它得到修复,至少这些步骤很容易退出,以便它正常工作.
我认为隐式依赖"应该可以工作,而无需经过第 6 步,甚至可能是第 5 步,但对于很多人的口味来说,这可能有点太自动化了.
I want to manage projects in workspaces using Xcode 4 with Cocoa Touch Static Library projects which contain shared code that I could reference from other projects. According to WWDC 2010 videos and the Xcode 4 documentation there is a feature for "implicit dependencies" for workspaces in Xcode 4. I have been trying to make it work and I am not having much success.
Sample Workspace: DependenciesInXcode4.zip
You can see the very basic sample project has 2 static library projects which I named Library1 and Library2. I then have a single class in each project which I reference from the iPhone project called PrimaryApp. I get support from Code Sense when adding the import statement but the build fails.
You can see how the build fails because it cannot find the dependencies.
To resolve these issues I added manually linked the Library1 and Library2 projects.
I also had to add the path to these projects as Header Search Paths.
Now when I build both of the dependency libraries and then run PrimaryApp in the iPhone Simulator it builds successfully and runs. I have found that it does not always ensure that the dependency projects are built when necessary and this is clearly a manual process. This is not what I consider "implicit dependencies" as the Xcode videos and documentation imply that it should work. I have been looking for more concrete examples but so far I have had no luck. Even here on Stackoverflow I do not see a satisfactory answer yet.
It appears that developers are falling back to old techniques and not truly using the new "implicit dependencies" features.
I'd appreciate some help with understanding how to get "implicit dependencies" to work with workspaces in Xcode 4.
Here are my questions:
I have just spent the best part of two days building and rebuilding our project, struggling with just this very issue. Whilst I now have a project that builds and links correctly AND has working codesense I am not 100% happy with one of the steps as it seems to be a bit of a hack and certainly doesn't fit my concept of "Automatic implicit dependencies".
FWIW here are the steps I took:
I really don't like steps 8 and 9. This really feels like XCode is not doing what it is advertised to do. However if and when it gets fixed at least these steps are fairly easy to back out so that it works correctly.
I think "implicit dependencies" should work without needing to go past step 6, maybe even step 5 but that might be a little bit too automagical for a lot of people's taste.
这篇关于在 Xcode 4 中,你如何获得隐式依赖来处理工作区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!