Since you are setting up the UITextFieldTextDidBeginEditingNotification
notification to call your textFieldDidBeginEditing:
method, you need to change the method parameter. And to avoid confusion with the corresponding UITextFieldDelegate
method, you should rename this method as well (which means you need to update the line of code that register the notification handler).
- (void)textFieldDidBeginEditingHandler:(NSNotification *)notification {
UITextField *textField = (UITextField *)notification.object;
// It's OK to use == here since we really do want to compare pointer values
if(textField == _nameF) {
NSLog(@"This if is called");
//[self.view setFrame:CGRectMake(0,-120,320,568)];
} else {
NSLog(@"Else called instead");
}
}
There is no need for tags since you have ivars for each text field.
BTW - why are you using notifications for this? Why not use the UITextFieldDelegate
methods?