This is my code:
while (true) {
if ([identificationField becomeFirstResponder]) {
NSLog(@\"finally!\");
break;
}
else{
i
Whatever is already the first responder can refuse to give up first responder status. In that case, your UITextField
won't become the first responder. So you should make sure that whatever is already the first responder isn't refusing to give up that status.
EDIT:
You won't want to leave this in an app when submitted to the app store, but here's some code that uses a private API to determine the current first responder:
UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
UIView *firstResponder = [keyWindow performSelector:@selector(firstResponder)];
You can use that to see what the first responder is, and that may help you find out why you can't get it to resign, if that's indeed the problem.