开发者

Visual Studio Solution behavior in XCode

Is it possible to have multiple projects in one xcode project all accessible for simultaneous development?

Specific situation is to have an application and middleware library under simultaneous development in XCode: all source is accessible for modification (b开发者_StackOverflow中文版oth app's and lib's) but library code is building into library and linking to the app on its own build.

Visual Studio handles it with solution and projects inside, dependencies between them and build order.

What are the steps to get as closer to such behavior as possible?


An Xcode project can contain other Xcode projects, so you can set up a top level Xcode project to simulate a VS solution file. It's not a perfect match; for instance, there's no Find in Files command that will act across all the sub-projects, though you can set up custom searches that will do the equivalent for you. However, you can tell the top level project to build, and it will build all the sub-projects.

To do this, start by creating an empty project: File > New > Empty Project.

Then add a target to it by right clicking the Targets icon and selecting Add > New Target... > Aggregate.

Now start adding your library projects to the empty project: right click the project icon, and select Add > Existing Files..., then navigate to your .Xcode project file.


If I understand your question correctly, I think you are referring to Xcode WorkSpace. You can put multiple projects in one workspace, edit/build/link all together.

Here is a tutorial that I found very helpful:

http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/

This documents how you add your application and a static library to an Xcode4 workspace and how you link the library against your application. It also contains useful information how you build a library that is more reusable.

I was able to build a simple command line tool which is linked against a .a library by following that tutorial.

Hope this can help.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜