I am writing unit tests for an app for iPhone using objective c.
I want to use some variable only when compiling for test case for example
#ifdef UNIT_TESTING
@synthesize requestFinished, networkAvailable;//etc
#endif
now where should I define UNIT_TESTING that when I compile for unit tests it should enter this code block…. otherwise should go past it….
Define it in the “Preprocessor Macros” build setting in each of your targets—especially the one where you want that macro defined, the unit test bundle target.