I am writing a class library for Mac OS X and iOS to be released as a Cocoa Framework for OS X and a Static Library for iOS. To simplify matters, I intend to use multiple targets in Xcode. However, the classes on Mac OS X link against Cocoa.h whereas on iOS they link against Foundation.h.
My questions basically are:
- Could the Mac OS X framework link against Foundation.framework instead? Classes used within the framework are NSString, NSMutableString, and NSMutableArray.
Or could I use preprocessor directives within the header files to control framework inclusion, e.g.
#ifdef MacOSX #import <Cocoa/Cocoa.h> #else #import <Foundation/Foundation.h> #endif