输入时UITextField中的EXC_BAD_ACCESS [英] EXC_BAD_ACCESS in UITextField while typing

查看:101
本文介绍了输入时UITextField中的EXC_BAD_ACCESS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个全新的基于视图的项目并添加到viewDidLoad

I created a brand new view-based project and added into the viewDidLoad

- (void)viewDidLoad
{
    [super viewDidLoad];
    myField = [[UITextField alloc] initWithFrame:CGRectMake(50, 50, 150, 31)];
    myField.delegate=self;
    [self.view addSubview:myField];
    [myField release];
}

我的头文件是

@interface textfieldpracticeViewController : UIViewController<UITextFieldDelegate>{
UITextField *myField;
}

当我点击文本字段并弹出键盘时,我开始输入但是在第二个字符,我得到exc_bad_access错误。我使用NSZombieEnabled,NSDebugEnabled,MallocStackLoggin和MallocStackNoCompact运行它,但它们无法捕获错误。

when i click in the textfield and the keyboard pops up, i start typing but on the 2nd character, i get the exc_bad_access error. I ran it with NSZombieEnabled, NSDebugEnabled, MallocStackLoggin, and MallocStackNoCompact but they weren't able to catch the error.

使用iphone 4.3模拟器时失败,但是当我在iphone上构建它时工作正常。这是一个xcode错误还是我错过了什么?

This fails when using the iphone 4.3 simulator, but works fine when i build it on my iphone. is this an xcode error or am i missing something?

谢谢

P.S。甚至尝试过属性/合成出来的解压

P.S. even tried property/synthesize out of desparation

推荐答案

尝试在模拟器的键盘设置中禁用自动更正。这似乎是模拟器iOS的自动更正系统中的一个错误。

Try disabling autocorrection in the simulator's keyboard settings. This seems to be a bug in the autocorrection system of the simulator's iOS.

这篇关于输入时UITextField中的EXC_BAD_ACCESS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆