• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

UITextField文本输入后,iOS应用程序崩溃,弹出,然后按我的navControllerNSISObjectiveLinearExpression coefficientForVariable

用户头像
it1352
帮助1

问题说明

我的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

正确答案

#1

我也有这个问题。使用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
系列文章
更多 icon
同类精品
更多 icon
继续加载