Monday, October 12, 2009

Honnan lehet tudni, hogy Simulator-ban fut-e az app

Valasz a stackoverflow-rol:

It's in the SDK docs under "Compiling source code conditionally"

The relevant definitions are TARGET_OS_IPHONE and TARGET_IPHONE_SIMULATOR, which will be defined provided that you

#include "TargetConditionals.h"

Since that won't exist on non apple platforms, you can wrap your include like this

#ifdef __APPLE__
#include "TargetConditionals.h"
#endif

before including that file

So, for example, if you want to check that you are running on device, you should do

#if !(TARGET_IPHONE_SIMULATOR)

Itt is felmerult ugyanez a kerdes. Es itt van az iPhone Reference Library-ban.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.