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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:27:06+00:00 2026-06-12T12:27:06+00:00

How to define preprocessor macros in build settings, like IPAD_BUILD, and IPHONE_BUILD (and how

  • 0

How to define preprocessor macros in build settings, like IPAD_BUILD, and IPHONE_BUILD (and how to use them in my factory methods)?

I’m using these by heart now, would be cool to know what is going behind.

  • 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-06-12T12:27:08+00:00Added an answer on June 12, 2026 at 12:27 pm

    /#if works as usual if:

    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
      if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
        return YES;
      }
    #endif
      return NO;
    }
    

    /#ifdef means “if defined – some value or macros”:

    #ifdef    RKL_APPEND_TO_ICU_FUNCTIONS
    #define RKL_ICU_FUNCTION_APPEND(x) _RKL_CONCAT(x, RKL_APPEND_TO_ICU_FUNCTIONS)
    #else  // RKL_APPEND_TO_ICU_FUNCTIONS
    #define RKL_ICU_FUNCTION_APPEND(x) x
    #endif // RKL_APPEND_TO_ICU_FUNCTIONS
    

    or:

    #ifdef __OBJC__
        #import <Foundation/Foundation.h>
    #endif
    

    Use this link for more information
    http://www.techotopia.com/index.php/Using_Objective-C_Preprocessor_Directives

    To test whether you running iPad or not you should have smth like this:

    #define USING_IPAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad
    
    if (USING_IPAD) {
        NSLog(@"running iPad");
    }
    

    Here’s another useful preprocessor functions:

    #ifdef DEBUG
        //here we run application through xcode (either simulator or device). You usually place some test code here (e.g. hardcoded login-passwords)
    #else
        //this is a real application downloaded from appStore
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I define a preprocessor macro when using xcodebuild? I need to build
When using C preprocessor one can stringify macro argument like this: #define TO_STRING(x) a
I am using Preprocessor Directives to define function macros in C. Can I have
Suppose I have the following preprocessor definition #define MYNUMBER 10f; I would then like
If I add a macro FOO=bar under GCC_PREPROCESSOR_DEFINITIONS (or Preprocessor Macros if you use
Is it possible to log or print preprocessor macros in XCode to the build
I have a preprocessor macro defined in build settings FOO=BAR That value I want
I'm using preprocessor macros to declare some repetitive variables, specifically: QuitCallbackType quitCallback; LossCallbackType lossCallback;
Is there a simple preprocessor macro that is defined for a 64-bit build? I
Is there a way to run the GCC preprocessor, but only for user-defined macros?

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.