如何在iOS中实现深层链接移动到不在主页上的特定页面?

嗨,大家好,我是新手在iOS我有一个问题,我正在深入链接它总是在主页上,但我想移动到另一个页面,而不是主页我的代码是在下面

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ if([[url host] isEqualToString:@"page"]){ if([[url path] isEqualToString:@"/main"]){ [self.leftPanelNavigationController setViewControllers:@[[[ZViewController alloc] init]] animated:YES]; } if([[url path] isEqualToString:@"/1"]){ [self.frontPageNavigationController pushViewController:[[ZContactUsVC alloc] init] animated:YES]; } else if([[url path] isEqualToString:@"/2"]){ [self.frontPageNavigationController pushViewController:[[ZAboutUsVC alloc] init] animated:YES]; } return YES; } else{ return NO; } return [FBAppCall handleOpenURL:url sourceApplication:sourceApplication]; } 

和我的url计划是'zameen',当我inputSafari浏览器'zameen:// page / 1'它去第一VC,但我定义'联系VC'为'1'

请帮助我提前感谢。

检查这首先是它的工作。 最后我们可以解决如果条件为page 。 现在检查这个

 - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation{ // if([[url host] isEqualToString:@"page"]){ if([[url lastPathComponent] isEqualToString:@"main"]){ [self.leftPanelNavigationController setViewControllers:@[[[ZViewController alloc] init]] animated:YES]; } if([[url lastPathComponent] isEqualToString:@"1"]){ [self.frontPageNavigationController pushViewController:[[ZContactUsVC alloc] init] animated:YES]; } else if([[url lastPathComponent] isEqualToString:@"2"]){ [self.frontPageNavigationController pushViewController:[[ZAboutUsVC alloc] init] animated:YES]; } return YES; // } // else{ // return NO; } return [FBAppCall handleOpenURL:url sourceApplication:sourceApplication]; }