Target_iphone_simulator and Target_os_iphone are Apple's two macro definitions,
Located in Ios->usr/include/targetconditionals.h in the real-machine SDK,
In the emulator SDK in simulator->usr/include/targetconditionals.h
(The version of Xcode I'm using at this time is 5.1,SDK version 7.1)
Look closely at the definitions in its simulator SDK:
#define Target_os_iphone 1
#define Target_iphone_simulator 1
Then look at the definition in the real-machine SDK:
#define Target_os_iphone 1
#define Target_iphone_simulator 0
It can be found that the difference between the two is only the value of target_iphone_simulator , and Target_os_iphone is the same, is true.
So, when we distinguish the real-time simulator, we must use target_iphone_simulator to judge, the use of Target_os_iphone will not be effective.
The logic of this and the normal person should be conflict (anyway I think so, Khan)
So when you use it, be careful not to get a hole in the apple!