简体   繁体   English

iOS包含来自另一个xcode项目的UIViewController

[英]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.

相关问题 如何在iOS中将一个Xcode项目使用到另一个Xcode项目中? - How to use one Xcode project into another Xcode project in iOS? 无法从Spritekit SKScene转到另一个UIViewController,XCODE8 / Swift - Unable to segue from Spritekit SKScene to another UIViewController, XCODE8/Swift 将iOS Storyboard项目包括到另一个项目中吗? - Include an iOS Storyboard project into another one? 从另一个UIViewController呈现UIViewController - Present UIViewController from another UIViewController 包含问题:在Xcode 4的iOS项目中找不到头文件 - Include issue: header file not found in iOS project in Xcode 4 最佳实践:从iOS中的另一个实例访问UIViewController实例 - Best Practice: Accessing instance of UIViewController from another in iOS iOS 7:如何从其他方法更改为另一个UIViewController? - iOS 7: How to change to another UIViewController from an others method? 从一个UIViewController转到另一个不使用导航(segue)iOS 6 - go from one UIViewController to another without using navigation (segue) iOS 6 iOS:如何从一个UIViewController切换到另一个,包括SWRevealViewController - iOS: How to switch from one UIViewController to another, including in SWRevealViewController iOS-从另一个选项卡转到某个选项卡的第二个uiviewcontroller - iOS - go to second uiviewcontroller of some tab from another tab
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM