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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:41:13+00:00 2026-05-17T16:41:13+00:00

Will this check work on the iPad as well as iPhone? I guess I

  • 0

Will this check work on the iPad as well as iPhone? I guess I am just confused about using the term “iPhone” on an iPad. Is there something else I need to check for iPad OS version or does the macro refer to the general iOS version.

#if __IPHONE_4_0
// Do stuff
#elif __IPHONE_3_0
// Do 3.0 stuff
#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-17T16:41:13+00:00Added an answer on May 17, 2026 at 4:41 pm

    The problem with __IPHONE_3_0 and the like is that they are defined even if targeting other iOS versions; they are version identification constants, not constants that identify the target iOS version. Use __IPHONE_OS_VERSION_MIN_REQUIRED

    #if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_4_0
    #elif __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_3_0
    #else
    #endif
    

    or even:

    #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000
    #elif __IPHONE_OS_VERSION_MIN_REQUIRED >= 30000
    #else
    #endif
    

    to get around the bug mentioned in the comments for “How to target a specific iPhone version?” __IPHONE_OS_VERSION_MAX_ALLOWED might also be of use, in limited circumstances.

    And, yes, it doesn’t matter what device the app will run on. These constants are defined by the compiler and don’t exist on the devices. Once the pre-processor runs, no macros are left. Though there are differences in the devices themselves, the iPhone and iPad both run iOS, and that’s what you’re really targetting.

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

Sidebar

Related Questions

I would like to check what colors is present in a image. This will
So this question will get technical – eventually – but first check out Hanselminutes
i have this code that will check the array contains the specific string and
I have this code that will check for if the class more-results are in
Will this work for testing whether a value at position index exists or not,
Updated Will this line of code work: boost::shared_array<struct sockaddr> addr( reinterpret_cast<struct sockaddr *>( (ipv6
I know this will probably lead to a security breach, but is there a
I just wanted someone to check this cron code for me, and let me
Alright, here we go! I am currently developing an iPhone app that will work
Will this work? $username = mysql_real_escape_string(isset($_POST['username'])) ? $_POST['username'] : ''; I know the ternary

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.