作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的应用程序委托(delegate)有一个 RootViewController *viewController;应用程序将以此 View 启动。
从现在开始,当用户导航到应用内的不同功能时,我将继续呈现模态视图(最多 3 级)。
我已将应用程序设置为接收推送通知,并且在应用程序委托(delegate)内设置了 didReceiveRemoteNotification 来检索有效负载。
现在问题:
最佳答案
没有通用的内置方法可以做到这一点。最好的解决方案可能是向您的应用程序委托(delegate)添加一个属性,您可以在其中存储它。
@property (nonatomic, retain) UIViewController *currentModalViewController;
当您呈现模态视图 Controller 时,请执行以下操作:
#import "MyAppDelegate.h"
// ....
MyAppDelegate *appDelegate = (MyAppDelegate *)[UIApplication sharedApplication].delegate;
appDelegate.currentModalViewController = vc;
[self presentModalViewController:vc animated:YES];
您还需要确保在解雇时丢失引用资料:
[self dismissModalViewControllerAimated:YES];
MyAppDelegate *appDelegate = (MyAppDelegate *)[UIApplication sharedApplication].delegate;
appDelegate.currentModalViewController = nil;
然后在您的应用程序委托(delegate)中,您拥有关闭当前模态视图 Controller 并检查当前是否存在模态视图 Controller 所需的一切。
关于ios - didReceiveRemoteNotification 和模态视图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7872238/
我来自 Asp.Net 世界,试图理解 Angular State 的含义。 什么是 Angular 状态?它类似于Asp.Net中的ascx组件吗?是子页面吗?它类似于工作流程状态吗? 我听到很多人
我一直在寻找 3 态拨动开关,但运气不佳。 基本上我需要一个具有以下状态的开关: |开 |不适用 |关 | slider 默认从中间开始,一旦用户向左或向右滑动,就无法回到N/A(未回答)状态。 有人
我是一名优秀的程序员,十分优秀!