What is the difference between #ifdef __IPHONE_3.2 and #if __IPHONE_3.2?

Posted by Jonathan on Stack Overflow See other posts from Stack Overflow or by Jonathan
Published on 2010-04-23T14:33:30Z Indexed on 2010/04/23 14:43 UTC
Read the original article Hit count: 418

Filed under:
|
|
|
|

Hi,

I have an iphone app that needs to work for 3.1.3 for the iPhone and 3.2 for the iPad. It is an iPhone app that I want to work on the iPad.

The main difference is the MPMoviePlayerController which introduces/and deprecates lots of things in 3.2.

Since, the iPhone OS only goes up to 3.1.3 and the iPad is on 3.2, I need to seperate my code so it only compiles the required code for the respective OS.

I can't use [[UIDevice currentDevice] model] because I end up with deprecated warnings on the 3.1.3 code. Also, UIUserInterfaceIdiomPad is new in 3.2 so it doesn't work well with 3.1.3...

So, I decided to use this, which only compiles what is necessary for the particular OS:

#if __IPHONE _3_2

//do 3.2 iPad stuff

#else

//do 3.1.3 iPhone/iPod Touch stuff

#endif

My question is... What is the difference between these?

#ifdef __IPHONE_3_2

and

#if __IPHONE_3_2

Thank you

© Stack Overflow or respective owner

Related posts about macros

Related posts about iphone