- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 iOS7 中遇到应用程序崩溃问题,但在 iOS6 上却可以正常工作。在从我的 AppDelegate 调试下一个代码时,我检查了在 iOS7 中是否执行了下一个函数,然后加载了模态视图 Controller 。
- (void)presentModalWebViewWithURL:(NSURL *)url title:(NSString *)title
{
[self.modalWebViewController dismissModalViewControllerAnimated:YES];
self.modalWebViewController = [[[MyModalWebViewController alloc] initWithURL:url] autorelease];
self.modalWebViewController.title = title;
UINavigationController *nav = [self.modalWebViewController modalNavigationControllerWithTarget:self dismissSelector:@selector(dismissModalWebView)];
[self.window.rootViewController presentViewController:nav animated:YES completion:NULL];
}
在 iOS6 中,我检查了函数在最后一行停止执行,直到加载模态视图 Controller 。
在 iOS7 中发生的事情是,当模态视图 Controller 尝试加载正在运行的 viewWillAppear
时,我能够检查模态视图 Controller 是否已更改所有值,甚至属性都指向对象不同类型的。我猜它们正在被释放,但我不知道为什么以及如何解决它。有什么建议吗?
最佳答案
当您关闭模态视图 Controller 时,您应该在呈现该 View Controller 的 View Controller 上调用关闭方法。此外,dismissModalViewControllerAnimated:
方法已被弃用,您应该使用 dismissViewControllerAnimated:completion:
。因此,查看您的代码,您可能应该在 self.window.rootViewController
上调用解雇方法,因为这就是您呈现模态视图的方式。
另外,不知道代码的其余部分看起来如何,我假设第一次调用时,self.modalWebViewController
为 nil,所以您可能想检查 self 是否.modalWebViewController
在您调用关闭之前设置为某些内容,并且在您关闭它时将其设置为 nil。
关于ios - iOS7 中的 ModalView 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20706581/
我必须单击“完成”按钮才能以编程方式关闭模态视图。我认为 UIButton 比 UIBarButtonItem 添加 UIControlEventsTouchupInside 更好。 但是对于 UIB
我创建了一个模态视图,加载在我的 tabBar 顶部,作为一个 3 步欢迎屏幕。 虽然一切正常,但我遇到的问题是找到一种只加载一次的方法,这样用户就不必在每次加载时都处理欢迎消息。 我做了一些研究,看
我有一个 segue 类型是模态的,我将它的 presentationstyle 设置为 formsheet。 这是屏幕截图。 当我点击变暗的 View 时,“弹出窗口” View 不会自行消失。在模
我查看了不同的来源以找到答案,并可能尝试了几种方法来 reloadData() 但到目前为止没有运气。 这是我的情况: 我有一个 tabBar,我在 tableView 中显示内容。当您进入该选项卡时
希望有人能指出我的启动屏幕做错了什么。问题是屏幕以纵向模式显示,而不是横向模式...... - (void)showSplash { UIView *modelView = [[UIView a
我想在 viewController 上显示模态视图。 (它有一个导航 Controller )。 在我看来,我有文本和一个显示模态视图的按钮。 我创建了一个包含我的模态视图的 .xib(它是一个带有
异常消息: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: Application tried to p
我有一个 modalView,它由两个不同的 UIViewController A 和 B 呈现。我想做的是检测 modalView 是来自 A 还是 B,并执行一些不同的操作。 我想我可以使用委托(
我在 iOS7 中遇到应用程序崩溃问题,但在 iOS6 上却可以正常工作。在从我的 AppDelegate 调试下一个代码时,我检查了在 iOS7 中是否执行了下一个函数,然后加载了模态视图 Cont
我正在使用 tabBarController 和 navigationController我在 TabBarController 的其中一个 viewController 上显示一个 Half Mod
我有一个问题,我做了这个: Impostazioni *impostazioni=[[Impostazioni alloc] initWithNibName:@"Impostazioni" bundl
我如何将呈现模态视图 (MV) 的 UIViewController (VC) 推送到具有单个从左到右过渡动画的屏幕? 我试过: 设置 MV 的模态过渡样式,然后将两个 Controller 添加到导
我很难弄清楚如何使用 ModalView 小部件内按钮的 on_press 属性正确更改屏幕。 按下 ModalView 中的按钮时,我希望屏幕更改为 Game1HomeScreen 类和其他 Gam
我如何在 tableView4 的 tableViewController 中关闭 tableView4 和 tableView3? 最佳答案 UINavigationController *m
我有点不知所措...... 我有一个基于标签栏的应用程序,开始时带有登录屏幕。在标签栏 Controller 出现之前,登录屏幕应该作为模态视图 Controller 完成。 问题是我只能在 TabB
我有一个带有 tabbarcontroller 和 navigationcontroller 的 iOS TabBar 应用程序。在我的详细 View 中,从我的第一个选项卡 tableviewcon
我正在尝试从一个 viewcontrol 发送标签数据以显示在另一个 View 控件中。 代码从按钮发送信息,我需要了解的是如何发送标签信息。 打开模式: -(IBAction) showModal:
这个问题在这里已经有了答案: 关闭 11 年前。
我使用以下内容创建了一个基于窗口的应用程序 TableViewController(没有 XIB 文件) 一个 ViewController(带有 XIB 文件)<-- 用作模态视图 用于存储一些数据
在我的应用程序中,我呈现多个 View ,一个在另一个之上。 所以当我想从所有 View 中出来时,我必须多次按取消。 例如,HOME->OneViwe(modalView)->SubView(mod
我是一名优秀的程序员,十分优秀!