Search code examples
objective-ccocoacocoa-touchinterface-builderiboutlet

Set object property to be the same as File Owner property in Interface Builder


I have a NSWindow in a nib-file owned by a MYWindowController. The nib-file has a bunch of MYViewController objects. I wan't to set MYViewController.managedObjectContext to be the same as MYWindowController.managedObjectContext but I'm not able to connect those two in Interface Builder.

Is doing this in code my only option? E.g. in MyWindowController:

- (void)windowDidLoad { // or awakeFromNib
    self.myViewController.managedObjectContext = self.managedObjectContext;
}

Solution

  • You can't do that type of connection in Interface Builder.