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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:59:33+00:00 2026-05-11T04:59:33+00:00

As the question states, I would mainly like to know whether or not my

  • 0

As the question states, I would mainly like to know whether or not my code is running in the simulator, but would also be interested in knowing the specific iphone version that is running or being simulated.

EDIT: I added the word ‘programmatically’ to the question name. The point of my question is to be able to dynamically include / exclude code depending on which version / simulator is running, so I’d really be looking for something like a pre-processor directive that can provide me this info.

  • 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. 2026-05-11T04:59:33+00:00Added an answer on May 11, 2026 at 4:59 am

    Already asked, but with a very different title.

    What #defines are set up by Xcode when compiling for iPhone

    I’ll repeat my answer from there:

    It’s in the SDK docs under ‘Compiling source code conditionally’

    The relevant definition is TARGET_OS_SIMULATOR, which is defined in /usr/include/TargetConditionals.h within the iOS framework. On earlier versions of the toolchain, you had to write:

    #include 'TargetConditionals.h' 

    but this is no longer necessary on the current (Xcode 6/iOS8) toolchain.

    So, for example, if you want to check that you are running on device, you should do

    #if TARGET_OS_SIMULATOR     // Simulator-specific code #else     // Device-specific code #endif 

    depending on which is appropriate for your use-case.

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

Sidebar

Related Questions

I would (as the question states) like to make an asynchronous call, preferably using
As the question states, i am a C#/Java programmer who is interested in (re)learning
The current top-voted to this question states: Another one that's not so much a
In @mmalc's response to this question he states that In general you should not
As the question states - is there a good tool out there which lists
On this question , there's an answer that states: You can use typedef to
An answer to a Stack Overflow question stated that a particular framework violated a
Question as stated in the title.
As just stated in a recent question and answer , you can't inherit from
As I stated in this question , I am using SDL for a small

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.