john903

macrumors member
Original poster
Apr 11, 2008
66
0
I was using these macros to determine if I was in Mac or iPhone but they no longer work with the latest SDK. Does anyone know what macros I can use to determine what platform I am on in my code? Thanks!
 

john903

macrumors member
Original poster
Apr 11, 2008
66
0
Those don't work for me either. Are these macros defined in a header file that I have to include?
 
Comment

kainjow

Moderator emeritus
Jun 15, 2000
7,958
6
Make sure you use it like so:
Code:
#if (TARGET_IPHONE_SIMULATOR)
// iPhone simulator code here..
#else
// blah
#endif
They will always be defined (when compiling for the iPhone) so you can't just check for #ifdef.
 
Comment

john903

macrumors member
Original poster
Apr 11, 2008
66
0
Ok, I found the problem. The macros are detected correctly in my .mm files but not in my cpp files. Any ideas?
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.