I'm currently writing an RSS program in which my splitViewController's views have to talk to each other. Both of them currently hold a propertied instance of each other which is declared in the App Delegate as mentioned below. I want to know if this is bad programming practice and what should I do to avoid it if so?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
FCListViewController *lvc = [[FCListViewController alloc]initWithStyle:UITableViewStylePlain];
UINavigationController *masterNav = [[UINavigationController alloc] initWithRootViewController:lvc];
FCContentViewController *cvc = [[FCContentViewController alloc] init];
/*----------------------------------------- */ //<---------My question lies here
[lvc setContentViewController:cvc];
[cvc setListViewController:lvc];
/-----------------------------------------/
//[lvc setWebViewController:wvc];
//[[lvc navigationItem]setTitle:@"Falcon RSS Feed"];
// [[self window] setRootViewController:masterNav];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
UINavigationController *detailNav = [[UINavigationController alloc] initWithRootViewController:cvc];
NSArray *vcs = [NSArray arrayWithObjects:masterNav, detailNav, nil];
UISplitViewController *svc = [[UISplitViewController alloc] init];
[svc setDelegate:cvc];
[svc setViewControllers:vcs];
[[self window]setRootViewController:svc];
[[svc view] setBackgroundColor:[UIColor clearColor]]; //eliminates annoying black background for the listViewController when rotated
}
else{
[[self window] setRootViewController:masterNav];
}
UIColor *blueHue = [UIColor colorWithRed:.2 green:.3 blue:.5 alpha:.7];
self.window.backgroundColor = blueHue; //Sets upper most background.. noticed when rotating
[self.window makeKeyAndVisible];
return YES;
}