MonoDevelop / MonoTouch #if iPHONE?

I am currently working on a multi-platform application for iPhone and other devices. As far as I can tell, I can use preprocessor directives to check if I'm building an iPhone or another platform, so for example, I could

#if WINDOWS_PHONE ScreenRes = new Vector2(800,480); #endif #if XBOX360 ScreenRes = new Vector2(1280,720); #endif 

However, I'm not sure which ad I should use to check on the iPhone, I have already tried IPHONE, IOS, I_PHONE and a few others.

+7
source share
2 answers

We do not define by default. You can do this by adding a definition yourself when you create it using MonoDevelop for your configurations.

+8
source

Recent versions of Xamarin Studio will provide additional options to the compiler.

eg. for Xamarin.iOS, both __MOBILE__ and __IOS__ will be defined.

eg. for Xamarin.Android, both __MOBILE__ and __ANDROID__ will be defined.

+4
source