我有一个自定义的URL Scheme,希望能够在打开此URL时跳转到非根视图控制器ViewController
。我已经成功实现了这一点,现在需要将该ViewController
推入navigationController
中,而我是在AppDelegate
中处理此URL的,请问应该如何操作?
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
if ([[url scheme] isEqualToString:@"njoftime"]) {
NSDictionary *getListingResponse = [[NSDictionary alloc]init];
getListingResponse = [Utils getListing:[url query]];;
if ([[getListingResponse objectForKey:@"status"] isEqualToString:@"success"]) {
ListingViewController *listingView = [[ListingViewController alloc]init];
[self.window.rootViewController.navigationController pushViewController:listingView animated:YES];
return YES;
}
但它只启动了我的应用程序,没有我想要启动的ListingViewController
。 有什么别的办法吗?