[英]iOS include UIViewController from another xcode project
I've spent some time building an iOS project, however I'd like to reuse one of the UITableViewControllers in another project. 我花了一些时间构建一个iOS项目,但是我想在另一个项目中重用一个UITableViewControllers。
This UITableViewControllers is quite complex (being a custom UITableViewController that inherits from another ViewController and contains multiple classes via #imports, so its not simply a case of copying over the .h, .m and .xib file) 这个UITableViewControllers非常复杂(是一个自定义的UITableViewController,它继承自另一个ViewController并通过#imports包含多个类,因此它不仅仅是复制.h,.m和.xib文件的情况)
Whats the best way to do this in xcode4? 什么是在xcode4中执行此操作的最佳方法? The options I've considered are building a library (.a), a framework (.framework) or importing the new xcodeproject into the original one.
我考虑的选项是构建一个库(.a),一个框架(.framework)或将新的xcodeproject导入到原始的xcodeproject中。
Thanks 谢谢
I think building your custom view controller into a static library would be the easiest method to include it in your new project. 我认为将自定义视图控制器构建到静态库中是将其包含在新项目中的最简单方法。 But will require a bit of work in the old project to make sure you get everything included and built correctly.
但是在旧项目中需要做一些工作才能确保包含所有内容并正确构建。 With Xcode 4, libraries are no longer built into 1 static fat library, you end up with 1 library just for the specific build.
使用Xcode 4,库不再构建到1个静态胖库中,最终只有1个库用于特定构建。 eg iphonesimulator-debug.
例如iphonesimulator-debug。 You will need to either include all the different versions of these libraries or add a build script that will build all of them in create just 1 static library (which will make your life much easier I can promise you that).
您需要包含这些库的所有不同版本,或者添加一个构建脚本,它将在创建一个静态库中构建所有这些库(这将使您的生活更轻松,我可以向您保证)。
This post on SO, Build Fat Static Library , saved me hours of work with static libraries. SO, Build Fat Static Library上的这篇文章为我节省了数小时的静态库。 Hopefully it will help you too.
希望它也会对你有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.