My URL map is as follows:
[map from:@"tt://webPage/(initWithPage:)" toSharedViewController:[WebPageController class]];
and in the WebPageController
- (id) initWithPage:(WebPage)page
{
if (self = [super init])
{
...
Then I called the url several times in my code
tt://webPage/1
tt://webPage/2
tt://webPage/1 (still called the initWithPage: everytime, not cached)
Why it is not cached as it is a SharedViewController?
I believe this is happening to you because
TTNaviagtoris broken on iOS 5. see https://github.com/facebook/three20/pull/719/files. Have you tried running the same code on a iOS 4 with the same result?My recommendation to you is to stop using
TTNaviagtor. You can still use the three20 library by pushing and popingTTViewControllerin the native ios method.Here’s an example on replacing the
TTNaviagtorin your app delegate:And
then you can push and pop any
TTViewController(or your own subclasses ofTTViewController) into the_masterNavController. Personally, i think TTNavigator is a bad design pattern, and apple designed their navigation system in different mindset.