需要在特定秒内在App Delegate中显示一个特定视图

时间:2014-01-29 05:40:05

标签: iphone objective-c ios7 xcode5

当推送通知收到需要在AppDelegate中显示一个特定视图(推送视图)30秒之后它想要消失。我在storyboard中完成的整个项目。单击在特定视图中设计的按钮(推送)查看),需要回到我在故事板中设计的主页。

1 个答案:

答案 0 :(得分:0)

首先,您可以看到第一个viewControler,无论其中有什么视图。收到通知后,您可以调用presentModalView控制器,然后在30秒后可以关闭模​​态viewController。例如 (在didReceiveNotificationPart中执行此操作)

收到通知电话时:

[self presentViewController:yourViewController animated:YES completion:NULL];

[self performSelector:@selector(dismissMyView) withObject:nil afterDelay:30];

解雇

-(void)dismissMyView
{

 [self dismissViewControllerAnimated:YES completion:nil] 

}