Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Same code base for iPhone/Desktop app

I have an iPhone/iPad app that I want to port to MacOSX. Most of my objective C classes should work just fine as long as they do not contain UIKit stuff. Obviously the interface will be different.

What is the best way to do this in Xcode? Start a completely new project? Add a new target? How can I keep the different platforms in sync? Should I just use git with multiple branches?

like image 260
hanno Avatar asked Jan 06 '11 16:01

hanno


1 Answers

I've had difficulty setting up a unified project with different targets for the two OS types, so I generally split this into two projects that share source files.

For an application that will be targeted Mac and iOS, I tend to create one directory for the application. I place the two projects within this, and set up one directory for shared source files, one for iOS-specific stuff, and a third for Mac-specific stuff. This way, you might have different projects, but shared files will update between them as they are changed. The only time you manually have to sync the two is when a new shared file is added to the application and must be added to both projects independently.

You should be able to restructure your existing project to support this without much trouble.

like image 186
Brad Larson Avatar answered Oct 31 '22 01:10

Brad Larson