iPhone - defining a conditional variable without a method
<p>I have a file called myConstants.h that I use to put all the constants used by the app. This file is imported in any class that needs to access one of the variables.</p>

<p>I am building a universal app and I have variables that I need to have different values if they are running on iPad or iPhone.</p>

<p>I give you a generic example of what I mean.</p>

<p>In my main code I may have something like:</p>

<pre><code>self.DEVICE = @"iphone";
self.IPAD = NO;

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    self.DEVICE = @"ipad";
    self.IPAD = YES;
}
</code></pre>

<p>But this is define on the main code. If I need a class to use one of these two variables I need to construct complex methods to reference the main class and read the variables there.</p>

<p>My idea is to include this in <code>myConstants.h</code>.</p>

<p>But how can I do that if myConstants.h is just a plain file where every line is a <code>#define</code> entry without any method?</p>

<p>My idea is to have <code>DEVICE</code> and <code>IPAD</code> variables as globals for the entire app and make them available to any class by just <code>#import "myConstants.h"</code>.</p>

<p>Is this possible? How?</p>

<p>thanks</p>
