Som*_*Man 5 c# simulator xamarin.ios
可能非常简单,但我找不到答案 - 如何在运行时(使用MonoTouch)进行检查以确保我在iPhone模拟器中(或不是)?
谢谢
Rol*_*nge 10
你可以这样做:
using MonoTouch.ObjCRuntime;
static bool InSimulator ()
{
return Runtime.Arch == Arch.SIMULATOR;
}
Run Code Online (Sandbox Code Playgroud)
这是从这里:http://docs.xamarin.com/ios/recipes/General/Projects/Environment_Checks