简体   繁体   English

将两个Xcode项目与通用文件合并

[英]Combine Two Xcode Projects with common files

I have two xcodeprojects named as Master.xcodeproj and Slave.xcodeproj .I had added static library on Slave.xcodeproj and added that as a sub project in Master.xcodeproj. 我有两个名为Master.xcodeprojSlave.xcodeproj的 xcodeprojects。我已经在Slave.xcodeproj上添加了静态库,并将其作为Master.xcodeproj中的子项目添加了。 Slave.xcodeproj has a viewcontroller SlaveViewController and Master.xcodeproj have a viewcontroller MasterViewController . Slave.xcodeproj具有一个视图控制器SlaveViewController和Master.xcodeproj具有一个视图控制器MasterViewController

Now, if I want to load SlaveViewController from a button click of a MastViewcontroller.m is that possible? 现在,如果我想从按钮上加载SlaveViewController,请单击MastViewcontroller.m。

UPDATE: 更新:

Ok you can reference the files of Slave project with #import"SlaveLibraryName/SlaveViewController.h" . 好的,您可以使用#import“ SlaveLibraryName / SlaveViewController.h”引用从项目的文件。 But the problem now I am facing is that I am getting duplicate symbols messages from the library since the Slave had files that were referenced from Master project and those files were added to static library. 但是现在我面临的问题是,由于从站具有从Master项目引用的文件,并且这些文件已添加到静态库中,因此我从库中收到重复的符号消息。 how to overcome that ? 如何克服呢?

Yes. 是。 All the code from each project can be available so you can do this normally by importing the header of SlaveViewController and instantiating it (or by segueing to one in a storyboard). 每个项目中的所有代码都可以使用,因此您可以通过导入SlaveViewController的标头并将其实例化(或在情节提要中选择一个)来正常执行此操作。 One complication with a static library is that it will not automatically add resources such as images, xibs, or storyboards to your target project. 静态库的一个复杂之处在于它不会自动将诸如图像,XIB或情节提要之类的资源添加到目标项目中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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