Domanda

I'm blocked on a total refresh of my application. I'm using Three20 framework and TTNavigator. At some moment I would like to remove and release all my views and viewcontroller (so have a blank screen) and then alloc them again. But I don't know how te do that. In my didFinishLaunchingWithOptions method I'm just doing this :

TTNavigator* navigator = [TTNavigator navigator];
navigator.persistenceMode = TTNavigatorPersistenceModeNone;
navigator.delegate = self;
navigator.window = self.window;

TTURLMap* map = navigator.URLMap;
[map from:@"cc://home" toSharedViewController:[HomeViewController class]];
[map from:@"cc://pictures" toViewController:[PicturesViewController class]];

I really don't know how to completely reboot my views and viewcontrollers. Thanks !

È stato utile?

Soluzione

It really depends on who is your first controller in the app. You can't really change that first controller since three 20 needs to start from somewhere.

Assuming you would like this ability what I suggest you do is: 1. create a fake root controller and have it be the first controller three20 uses. 2. in that controller push you real controller on the stack without animation. 3. when you want to reboot your controller simply pop all the controller (something like [self.navigationController popToRootViewControllerAnimated:YES] ). 4. catch the fact that the root controller (fake one) is about the show and push the real root controller.

BTW, assuming your root controller is a TabController you can always replace the tab controller using the viewControllers property on the tabcontrol.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top