I am trying to build a couple of apps within an XCode workspace: One app will be an iOS app and another will be a Mac OS X app. I'd like to have a certain set of classes that get included in both versions of the app. I'm struggling to figure out what kind of project structure would best support some code that is shared, some that is specific to the iOS app, and some that is specific to the Mac app. Is there a best practice for doing this kind of thing in XCode in general or XCode 4 specifically?
Should I be creating a library project for the shared code and creating 2 different targets for the iOS and Mac OS X builds of the library? The build-in project templates seem to want me to pick either a Mac OS X library or an iOS library, and I'm not sure if it's easy to make a project based on one of those templates work for both targets.
Should I instead be creating different projects for the iOS library, the Mac OS X library, the iOS app, and the Max OS X app? In this case, how can I easily have the library code shared between the iOS library and Mac OS X library projects?