title: add variable in AppDelegate Objective c
body: <p>I am trying to add two variabled in my appDelegate so that I can use them in other my view controller.</p>
  
  <p>My code looks like this:</p>
  
  <p>myappdelegate.h:</p>
  
  <pre><code>@class MyViewController1, MyViewController2; // controller than use my new variables
  
  @interface AppDelegate : UIResponder &lt;UIApplicationDelegate&gt;
  {
      NSString* firstVariable; 
      NSString* secondVariable; 
  }
  @property (retain) NSString* firstVariable;
  @property (retain) NSString* secondVariable;
  
  @end
  </code></pre>
  
  <p>In myappdelegate.m I synthesized the variables:</p>
  
  <pre><code>...
  @synthesize firstVariable = _firstVariable;
  @synthesize secondVariable = _secondVariable;
  ...
  </code></pre>
  
  <p>But when in my viewcontroller use myappdelegate don't find my new variables:</p>
  
  <pre><code>...
  mainDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
  ...
  mainDelegate.firstVariable = localVariable.text;
  ...
  </code></pre>
  
  <p>where is my error??</p>
  
  <p>Thanks to all.</p>