title: iOS: Conditional code depending on current target
body: <p>I have two targets in my iPhone iOS project: <code>Production</code> and <code>Preview</code>.</p>
  
  <p>I now want to execute a line of code, only if I am in the target <code>Preview</code>.
  I guess this would have to be some sort of <code>#ifdef ...</code>. I found <a href="https://stackoverflow.com/questions/3657102/how-to-have-conditional-code-depending-on-active-configuration">a solution</a> which does almost the thing I want but it uses the <em>configuration</em> and not the <em>target</em>.</p>
  
  <p>Example:</p>
  
  <pre><code>-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  
    #ifdef MY_PREVIEW_TARGET
      [SomeLibraryWhichIsInPreviewTarget someMethod];
    #endif
  
    // Code that applies for both targets ...
  }
  </code></pre>
  
  <p>Thanks for your help </p>