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 3315724
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:23:01+00:00 2026-05-17T22:23:01+00:00

What is a good way to write classes that can be used in both

  • 0

What is a good way to write classes that can be used in both iOS and Mac OS applications? I’m not trying to get a full cross-platform UI solution here, just a way to use several model classes from my iPhone app in a support application running on the Mac. Some of those classes require a few minor changes to get them compiling under Mac OS. This seems like a call for macros, but I don’t know which ones are typically used. Any suggestions or shared experience would be appreciated.

  • 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-17T22:23:02+00:00Added an answer on May 17, 2026 at 10:23 pm

    One way is like this example from a iOS/OSX multi-platform class header file:

    #if TARGET_OS_IPHONE        
    #import <UIKit/UIKit.h>
    #else
    #import <Cocoa/Cocoa.h>
    #endif TARGET_OS_IPHONE     
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Delphi (7-2010) and trying to figure out a good way to handle
What would be a good way (along with any pros and cons) of initializing
I want to build a system using Django that will allow users to build
I'm following an example in Accelerated C++ and writing a simple Handle class that
I am looking to write a contact synchronisation application for windows mobile and google
Is it possible to get WSDL.exe to generate interfaces as well as, or instead
I have an Activity with a listView with few options and a button at
I wrote an application using the Android 2.2 SDK (API level 8). It is
This is a fragment from Exceptional C++ Item 24, Solution, first bullet from the
The table consists of columns column_1, column_2, column_3. Given the set of string values

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.