title: How to assign NSManagedObjectContext from AppDelegate to ViewControllers in TabBased application?
body: <p>newbie type of question here.</p>
  
  <p>Since XCode doesn't provide project template for TabBased application with Core Data, so I have to go cutting and pasting Core Data stack from other templates to my TabBased application.</p>
  
  <p>This is how to assign <code>NSManagedObjectContext</code> object from <code>AppDelegate</code> to <code>MasterViewController</code> in Master-Detail application template:</p>
  
  <pre><code>// AppDelegate.m (Master-Detail template)
  
  - (BOOL)application:(UIApplication *)application 
      didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
      // Override point for customization after application launch.
      UINavigationController *navigationController = 
              (UINavigationController *)self.window.rootViewController;
      MasterViewController *controller = 
              (MasterViewController *)navigationController.topViewController;
      controller.managedObjectContext = self.managedObjectContext;
      return YES;
  }
  </code></pre>
  
  <p>How to assign <code>NSManagedObjectContext</code> from <code>AppDelegate</code> to ViewControllers in TabBased application?</p>