title: using appDelegate to share data - getting "request for member in __ not in structure or union"
body: <p>I've got a simple example where i have a delegate that has a string, along with a property to expose it.</p>
  
  <p>myAppDelegate.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  @interface myAppDelegate : NSObject &lt;UIApplicationDelegate&gt; {
      UIWindow *window;
      UITabBarController *rootController;
      NSString* myText;
  }
  
  @property (nonatomic, retain) IBOutlet UIWindow *window;
  @property (nonatomic, retain) IBOutlet UITabBarController *rootController;
  @property (nonatomic, retain) NSString *myText;
  @end
  </code></pre>
  
  <p>myAppDelegate.m</p>
  
  <pre><code>#import "myAppDelegate.h"
  @implementation myAppDelegate
  @synthesize window;
  @synthesize rootController;
  @synthesize myText;
  
  - (void)applicationDidFinishLaunching:(UIApplication *)application {    
      [window addSubview:rootController.view];
      [window makeKeyAndVisible];
  }
  
  - (void)dealloc {
      [rootController release];
      [window release];
      [super dealloc];
  }
  @end
  </code></pre>
  
  <p>So in my main view controller, I try something like this:</p>
  
  <pre><code>myAppDelegate* ad = (myAppDelegate*)[UIApplication sharedApplication].delegate;
  ad.myText = @"blah";
  </code></pre>
  
  <p>and I get: Request for member 'myText' in something not a structure or union</p>
  
  <p>does anyone know why this is happening?</p>