// Any URL that doesn't match will fall back on this one, and open in the web browser
[map from:@"*" toViewController:[TTWebController class]];
// The tab bar controller is shared, meaning there will only ever be one created. Loading
// This URL will make the existing tab bar controller appear if it was not visible.
[map from:@"tt://tabBar" toSharedViewController:[TabBarController class]];
// Menu controllers are also shared - we only create one to show in each tab, so opening
// these URLs will switch to the tab containing the menu
//菜单控制器是被共享的控制器,这意味着它只能被创建一次,
//所以打开这个url,就会选择包含这个控制器的标签。
//如果URL中有函数的时候MenuController 被alloc后,会调用initWithMenu,如果没有则调用init
[map from:@"tt://menu/(initWithMenu:)" toSharedViewController:[MenuController class]];
// A new food controllers will be created each time you open a food URL
//一个新的控制器将要被创建,在你每次打开这个url的时候
[map from:@"tt://food/(initWithFood:)" toViewController:[ContentController class]];
// By specifying the parent URL, we are saying that the tab containing menu #5 will be
// selected before opening this URL, ensuring that about controllers are only pushed
// inside the tab containing the about menu
//当我们调用这个url的时候,他首先会选中@"tt://menu/5"对应的标签,然后吧这个视图push进去
[map from:@"tt://about/(initWithAbout:)" parent:@"tt://menu/5"
toViewController:[ContentController class] selector:nil transition:3];
// This is an example of how to use a transition. Opening the nutrition page will do a flip
//引用这个例子的主要的目的是,为了说明动画的时候方法。
//这是为了传递多个参数
[map from:@"tt://food/(initWithNutrition:)/nutrition" toViewController:[ContentController class]
transition:UIViewAnimationTransitionFlipFromLeft];