Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EXC_BAD_ACCESS in UITextField while typing

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];
}

my header file is

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

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.

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?

Thanks

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

like image 469
Andrew Park Avatar asked Aug 09 '11 01:08

Andrew Park


1 Answers

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

like image 89
omz Avatar answered Oct 10 '22 06:10

omz