UITextField文本输入后,iOS应用程序崩溃,弹出,然后按我的navControllerNSISObjectiveLinearExpression coefficientForVariable
问题说明
我的iOS应用程序在我崩溃时崩溃:
My iOS app crashes when I:
- 在导航控制器中显示我的登录视图控制器
- 在其上输入文本到
UITextField
,然后尝试登录失败
- 弹回上面的视图控制器
- 推送到另一个视图控制器(此处崩溃)
- present my "Login" view controller in a navigation controller
- enter text into a
UITextField
on it, then try and fail the login - pop back to the above view controller
- push to a different view controller (crashes here)
不如果我跳过将文本输入 UITextField
的步骤,则会崩溃。
It doesn't crash if I skip the step where I enter text into the UITextField
.
有谁知道为什么?这是我得到的错误消息。
Does anyone have any idea why? Here is the error message I am getting.
[NSISObjectiveLinearExpression coefficientForVariable:]:无法识别的
选择器发送到实例0x1cd93850
正确答案
我也有这个问题。使用ARC,如果我将一个 UITextField
添加到一个空的xib中,我会得到这个崩溃,并且在编辑该字段后,弹出导航控制器堆栈的视图控制器。文本字段没有委托集,也没有连接到它的出口。然而它崩溃了!
I had this problem too. Using ARC, I would get this crash if I added a UITextField
to an otherwise empty xib and, after editing the field, popped its view controller of the navigation controller's stack. The text field had no delegate set and no outlets connected to it. And yet it was crashing!
(如果你的情况和我一样,你没有实例化 NSISObjectiveLinearExpression
mydogisbox暗示。)
(If your situation was like mine, you weren't instantiating a NSISObjectiveLinearExpression
as mydogisbox suggests. )
经过多次搜索,我发现这个答案,建议在 viewWillDisappear
方法中调用 endEditing:
。它似乎可以修复我的崩溃。
After much searching, I found this answer, which suggests calling endEditing:
in your viewWillDisappear
method. It appeared to fix my crash.
- (void) viewWillDisappear: (BOOL) animated {
[super viewWillDisappear: animated];
NSLog( @"In viewWillDisappear" );
// Force any text fields that might be being edited to end so the text is stored
[self.view.window endEditing: YES];
}
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcfjaji
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20