不能多次使用 segue
Can't use segue more than once
每当我的应用程序收到推送通知时,我都试图看到不同的 viewcontroller。我尝试使用
[self performSegueWithIdentifier:@"shootPicture" sender:self];
和
[self performSelectorOnMainThread:@selector(performSegueWithIdentifier:sender:) withObject:@"shootPicture" waitUntilDone:NO];
和
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *BombaViewController = [storyboard instantiateViewControllerWithIdentifier:@"BombaViewController"];
[self presentViewController:BombaViewController animated:NO completion:NULL];
上述所有示例都有效,但它们只有效一次!在 viewcontroller 返回主选项卡式控制器后,它不再起作用。
我还使用 NSLog 来确保系统确实可以拦截推送通知。
有什么建议吗?
I just put a button and dragged it to the starting Tabcontroller
这表明您有一个新的推送/模式转场。
因此,您并没有真正返回,您将转到选项卡控制器的一个新副本,该副本位于其他所有内容的前面。你真正应该做的是解除让你到达那里的 segue,或者将按钮连接到代码中的操作并调用 dismissViewControllerAnimated:completion:
.
每当我的应用程序收到推送通知时,我都试图看到不同的 viewcontroller。我尝试使用
[self performSegueWithIdentifier:@"shootPicture" sender:self];
和
[self performSelectorOnMainThread:@selector(performSegueWithIdentifier:sender:) withObject:@"shootPicture" waitUntilDone:NO];
和
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *BombaViewController = [storyboard instantiateViewControllerWithIdentifier:@"BombaViewController"];
[self presentViewController:BombaViewController animated:NO completion:NULL];
上述所有示例都有效,但它们只有效一次!在 viewcontroller 返回主选项卡式控制器后,它不再起作用。
我还使用 NSLog 来确保系统确实可以拦截推送通知。 有什么建议吗?
I just put a button and dragged it to the starting Tabcontroller
这表明您有一个新的推送/模式转场。
因此,您并没有真正返回,您将转到选项卡控制器的一个新副本,该副本位于其他所有内容的前面。你真正应该做的是解除让你到达那里的 segue,或者将按钮连接到代码中的操作并调用 dismissViewControllerAnimated:completion:
.