Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3799056
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:40:23+00:00 2026-05-19T13:40:23+00:00

I am writing a class library for Mac OS X and iOS to be

  • 0

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
    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T13:40:24+00:00Added an answer on May 19, 2026 at 1:40 pm

    You can use these to separate platform dependent code (see TargetConditionals.h):

    #ifdef TARGET_OS_IPHONE 
        // iOS
    #elif defined TARGET_IPHONE_SIMULATOR
        // iOS Simulator
    #elif defined TARGET_OS_MAC
        // Other kinds of Mac OS
    #else
        // Unsupported platform
    #endif
    

    Here’s a useful chart.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a Graph-class using boost-graph-library. I use custom vertex and edge properties
I'm writing a class library as an abstraction to use for logging in any
I am writing a class library(API) in C#. The class is non-static and contains
I'm writing a two-project solution with a class library designed for re-use, and an
I'm writing a class-library in VB.Net and one of the subs that are being
While making some final tests of a class-library that I'm writing for Windows Mobile
Is there a C or C++ compatible library for reading and writing Java class
I am writing a class library where i need to extend System.DateTime to have
I'm writing a class library in C# using sharp develop. I am including an
Im writing a C# class library component which is going to act as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.