EXC_BAD_ACCESS iPhone Development
- by gkres121
Sorry, this could be a simple fix, as I am new to iPhone Development.
In my Delegate, after pressing the create profile button, the create profile view is pushed:
-(void) createProfile_clicked:(id)sender {
AddNewProfile *create = [[AddNewProfile alloc] init];
[self.window addSubview:create.view];
[self invisibleCreateProfileBar];
AddNewProfile *controller = [[AddNewProfile alloc] initWithNibName:@"AddNewProfile" bundle:[NSBundle mainBundle]];
[ self.navigationController pushViewController:controller animated:YES ];
currentController=controller;
}
Then in the AddNewProfile.m:
- (IBAction)backgroundTap:(id)sender {
if([nameField isFirstResponder]){
[nameField resignFirstResponder];
}
if([ageField isFirstResponder]){
[ageField resignFirstResponder];
}
if([doctorNameField isFirstResponder]){
[doctorNameField isFirstResponder];
}
if([doctorNumberField isFirstResponder]){
[doctorNumberField resignFirstResponder];
}
}
This leads to a exc_bad_access error every time the FirstResponder is ever messed with, with any of my controls. I can select a control(text box), but once I click out of one, it crashes.
Any help would be greatly appreciated.