I am trying to build a library for inclusion in other iOS/Mac OS X projects. I currently have two separate projects that I switch between to build the library. I would like to have one project and two different schemes so that another person in my team can just change the scheme and get the kind of library they want. I would like to avoid having to manually add a new file to each separate project individually when I need to do so. Thoughts?
Asked
Active
Viewed 4,708 times
1 Answers
3
- Open your iOS project.
- Choose File > New > Target… from the menu bar.
- Click Framework & Library in the OS X section.
- Choose the Cocoa Library target.
- Enter a name for the OS X version of the library. It must be different than the iOS library name. Example: “MyLibraryOSX”.
- Maybe change the type to Static.
- Click Finish.
- Select your project itself in the Project Navigator.
- Click on the new OS X library target in the TARGETS section.
- Click on the Build Phases tab.
- Open the Compile Sources section.
- Note that Xcode automatically created a
.m
file with the same name as the OS X library target. You may wish to delete this from your project. - Add your library sources to the Compile Sources section.
Xcode normally creates a scheme for the new target automatically. If you have turned “Autocreate schemes” off for this project, you need to choose Product > Manage Schemes… and create (or ask Xcode to autocreate) the scheme for the new target.

rob mayoff
- 375,296
- 67
- 796
- 848
-
Thank you for your quick response this did what I needed to do. – user1660675 Nov 07 '12 at 15:44