Witam serdecznie,
Mam mały problem z metodą popToRootViewController. Nic się nie crashuje, ale ekran wygląda tak: Zrzut ekranu 2011-10-06 (godz. 10.58.37).png
Oto parę linijek kodu:
metoda klasy DataManager która ma powodować cofnięcie się do root'a po wywołaniu działań.
delegateKod:- (void) updateDatabase { (.....) AppDelegate *appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate; [appDelegate.navigationController popToRootViewControllerAnimated:YES]; }
A tutaj jeszcze zamieszczam viewDidAppear klasy RootViewController:Kod:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; if (_rootViewController == nil) { _rootViewController = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:[NSBundle mainBundle]]; } _navigationController = [[UINavigationController alloc] initWithRootViewController:_rootViewController]; _navigationController.navigationBar.hidden = YES; [self.window addSubview:_navigationController.view]; [self.window makeKeyAndVisible]; return YES; }
Ktokolwiek ma jakiś pomysł?Kod:- (void) viewWillAppear:(BOOL)animated { if([[User sharedInstance] getEmail] == nil) { if (_registerViewController == nil) { _registerViewController = [[RegisterViewController alloc] initWithNibName:@"RegisterViewController" bundle:[NSBundle mainBundle]]; } if (_registerNavController == nil) { _registerNavController = [[UINavigationController alloc] initWithRootViewController:_registerViewController]; } _registerNavController.navigationBarHidden = YES; [self.navigationController presentModalViewController:_registerNavController animated:YES]; return; } if (_listViewController == nil) { _listViewController = [[ListViewController alloc] initWithNibName:@"ListViewController" bundle:[NSBundle mainBundle]]; } [self.navigationController pushViewController:_listViewController animated:YES]; }![]()
Pozdrawiam!
Arek




LinkBack URL
About LinkBacks




