You can use the interface builder to achieve the same.
The following is a small modification (for some extra clarity) of the original Rog proposal - pay attention to
IBOutlet@interface AppDelegate : NSObject <UIApplicationDelegate> {
ViewController1 *vc1;
ViewController2 *vc2;
ViewController3 *vc3;
}
@property (nonatomic, retain) IBOutlet ViewController1 *vc1;
@property (nonatomic, retain) IBOutlet ViewController2 *vc2;
@property (nonatomic, retain) IBOutlet ViewController3 *vc2;
Then in the implementation file:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
vc1.managedObjectContext = self.managedObjectContext;
vc2.managedObjectContext = self.managedObjectContext;
vc3.managedObjectContext = self.managedObjectContext;
}
Interface Builder ctrl App Delegate View, , View , .