Is there any way to programmatically determine if you are running code in the Test target vs the regular Run target while developing iOS applications?
I have the hack of checking if this variable is nil or not as it is only in my test target but this seems pretty hacky.
[[[NSProcessInfo processInfo] environment] objectForKey:@"XCInjectBundle"]
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…