简体   繁体   中英

How to share files among Xcode Projects

I have made some categories of some classes such as NSArray and NSDictionary. I would like to use these categories in several projects. I may modify the files in any project, and I want all other projects get the updated files.

What's the best way to share files among projects?

I have read this problem and this problem . Someone recommended to add targets into the same project. This is not a good solution in my situation, because my projects are not related to each other, and I have many projects.

In your case you can create a static library and put all of your classes, class methods or sub classes then you can link to your individual projects.

Static libraries provide a convenient mechanism for sharing code among multiple applications. On iOS, static libraries are the only supported library type. This document explains how to extract code from your application into a new static library and how to use that static library in multiple applications.

Whenever you want to add/edit/remove something you can edit and rebuild your library. Creating the Library and Creating a Static Library in iOS .

When Xcode 6 and IOS 8 released IOS will support frameworks as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM