Parameters not passed back after init (UISplitViewController Subclassing)?

Up vote 0 down vote favorite share g+ share fb share tw.

I have an application with a tabBarController and UISplitView Controller. First. I've initialized UISplitView inside the BTAppDelegate (you can see it in commented code lines).

#import "BTAppDelegate. H" //#import "VideoMasterView. H" //#import "VideoDetailView.

H" #import "BTViewController. H" #import "VideoSplitViewController. H" @implementation BTAppDelegate @synthesize window = _window; //@synthesize splitViewController = _splitViewController; @synthesize tabBarController; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.

Window = UIWindow alloc initWithFrame:UIScreen mainScreen bounds; // Override point for customization after application launch. //Video Split View Init //VideoMasterView *videoMasterView = VideoMasterView alloc initWithNibName:@"VideoMasterView" bundle:nil; //UINavigationController *masterNavigationController = UINavigationController alloc initWithRootViewController:videoMasterView; //VideoDetailView *videoDetailView = VideoDetailView alloc initWithNibName:@"VideoDetailView" bundle:nil; //UINavigationController *detailNavigationController = UINavigationController alloc initWithRootViewController:videoDetailView; //Test Init of Login Dialog for Tab Bar Controller BTViewController *loginView = BTViewController alloc initWithNibName:@"BTViewController" bundle:nil; loginView. Title = @"Login"; VideoSplitViewController *videoSplitViewController = VideoSplitViewController alloc initWithNibName:nil bundle:nil; NSLog(@"Inited with title: %@", videoSplitViewController.

Title); //View for NavigationBar //masterNavigationController.navigationBar. BarStyle = UIBarStyleBlackTranslucent; //detailNavigationController.navigationBar. BarStyle = UIBarStyleBlackTranslucent; //self.

SplitViewController = UISplitViewController alloc init; //self. SplitViewController. Delegate = videoDetailView; //self.

SplitViewController. ViewControllers = NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil; //self. SplitViewController.

Title = @"My Videos"; //self. SplitViewController.tabBarItem. Image = UIImage imageNamed:@"45-movie-1"; //Tab Bar Controller for root View tabBarController = UITabBarController alloc initWithNibName:nil bundle:nil; tabBarController.

ViewControllers = NSArray arrayWithObjects:videoSplitViewController, loginView, nil; tabBarController. Delegate = self; self.window. RootViewController = self.

TabBarController; self. Window makeKeyAndVisible; return YES; } Now I want to remove UISplitView code from BTAppDelegate and move all init stuff to new UIViewController #import "VideoSplitViewController. H" #import "VideoMasterView.

H" #import "VideoDetailView. H" @implementation VideoSplitViewController @synthesize videoSplitController = _videoSplitController; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil //- (id)init { self = super initWithNibName:nibNameOrNil bundle:nibBundleOrNil; if (self) { //if (self = super init) { // Custom initialization VideoMasterView *videoMasterView = VideoMasterView alloc initWithNibName:@"VideoMasterView" bundle:nil; UINavigationController *masterNavigationController = UINavigationController alloc initWithRootViewController:videoMasterView; VideoDetailView *videoDetailView = VideoDetailView alloc initWithNibName:@"VideoDetailView" bundle:nil; UINavigationController *detailNavigationController = UINavigationController alloc initWithRootViewController:videoDetailView; NSLog(@"YEAH We tried it"); //View for NavigationBar masterNavigationController.navigationBar. BarStyle = UIBarStyleBlackTranslucent; detailNavigationController.navigationBar.

BarStyle = UIBarStyleBlackTranslucent; self. VideoSplitController = UISplitViewController alloc init; self. VideoSplitController.

Delegate = videoDetailView; self. VideoSplitController. ViewControllers = NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil; self.

VideoSplitController. Title = @"My Videos"; NSLog(@"title is set to: %@", self. VideoSplitController.

Title); self. VideoSplitController.tabBarItem. Image = UIImage imageNamed:@"45-movie-1"; } return self; } i've created the UIViewController Subclass (without nib) and then recreated controller and assigned UISplitView elements.

So my Tab Bar is not filling and console output shows me here is no parameters passed to instance: 2011-12-28 12:32:26.547 BuzzApp4276:707 YEAH We tried it 2011-12-28 12:32:26.550 BuzzApp4276:707 title is set to: My Videos 2011-12-28 12:32:26.553 BuzzApp4276:707 Inited with title: (null) Im pretty new to all this stuff, so maybe i've lack of some basic concepts or something. Any ideas? Thanks!

Objective-c ios cocoa-touch uiviewcontroller link|improve this question edited Dec 28 '11 at 19:40Monolo2,3943718 asked Dec 28 '11 at 8:52snikitin11.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions