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

  • SEARCH
  • Home
  • 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

Is there a good way to get the debug information that Django provides when
I'm basically just doing some tests to figure out a good way to write
I'm trying to write a class that would enable me to just write .save();
I sometimes write classes which can be converted to- and from- something else, and
Is there any way to write decorators within a class structure that nest well?
I noticed that I can add a reference not only to a DLL but
What is a good way to persist querystring values in asp.net mvc? If I
What would be a good way to determine if a string contains an IPv4
XmlAttributeOverrides is a good way to override some attributes for serialization. MSDN says: You
What's a good way to check if a package is installed while within 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.