View Full Version : TARGET_OS_EMBEDDED and TARGET_OS_ASPEN
Aug 4, 2008, 08:32 PM
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!
Aug 4, 2008, 09:22 PM
You can use TARGET_IPHONE_SIMULATOR, TARGET_OS_IPHONE
Aug 5, 2008, 10:51 AM
Those don't work for me either. Are these macros defined in a header file that I have to include?
Aug 5, 2008, 12:43 PM
Make sure you use it like so:
// iPhone simulator code here..
They will always be defined (when compiling for the iPhone) so you can't just check for #ifdef.
Aug 5, 2008, 04:20 PM
TARGET_IPHONE is actually what gets defined, not TARGET_OS_IPHONE
Aug 5, 2008, 09:09 PM
Ok, I found the problem. The macros are detected correctly in my .mm files but not in my cpp files. Any ideas?
Aug 6, 2008, 05:29 AM
You could try a #include <TargetConditionals.h>
Aug 6, 2008, 10:51 AM
Thanks! Worked perfectly!