title: passing a NSManagedObject to an UIViewController
body: <p>If I pass a NSManagedObject to a UIViewController, the NSManagedObject becomes null. The only way around it that I can see is to use a fetch request in each view controller i want to pass the managed object to (there are several) but this seems extremely clumsy and prone to error.</p>
  
  <p>The way I'm passing the managed object is just to say:</p>
  
  <pre><code>viewController.subclassedManagedObject = self.subclassedManagedObject;
  </code></pre>
  
  <p>it's valid in self but in viewController it's null. I don't understand why. any insight would be much appreciated!</p>
  
  <p>Many thanks</p>
  
  <p>Edit:</p>
  
  <p>to add a bit more detail and clarity: i have a strong subclassed managedObject property called booking in viewController. </p>
  
  <pre><code>@property (nonatomic, strong) Booking *booking;
  </code></pre>
  
  <p>This is also the viewController where I set up UIManagedDocument and such. This all works fine. I want to pass this managedObject to an instance of TableViewController which I do like this:</p>
  
  <pre><code>Booking *booking = [NSEntityDescription insertNewObjectForEntityForName:@"Booking" inManagedObjectContext:self.managedObjectContext];
  
  
      [self.bookingDatabase saveToURL:self.bookingDatabase.fileURL
              forSaveOperation:UIDocumentSaveForOverwriting
             completionHandler:^(BOOL success) {
                 if (!success) 
                 {
                  NSLog(@"didn't work");
                 }}];
  
      TableViewController *tableViewController = segue.destinationViewController;
      tableViewController.managedObjectContext = self.managedObjectContext;
      tableViewController.booking = self.booking; 
      tableViewController.bookingDatabase = self.bookingDatabase;
  </code></pre>
  
  <p>The property booking in TableViewController i've tried being both weak and strong and neither work. At the moment it's like this:</p>
  
  <pre><code>@property (nonatomic, weak) Booking *booking;
  </code></pre>
  
  <p>Many thanks again</p>