3

I've spent some time building an iOS project, however I'd like to reuse one of the UITableViewControllers in another project.

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)

Whats the best way to do this in xcode4? The options I've considered are building a library (.a), a framework (.framework) or importing the new xcodeproject into the original one.

Thanks

Dave
  • 95
  • 1
  • 10

1 Answers1

2

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. e.g. 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. Hopefully it will help you too.

Community
  • 1
  • 1
Bill Burgess
  • 14,054
  • 6
  • 49
  • 86