Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6648317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:38:29+00:00 2026-05-26T00:38:29+00:00

When I resign the first responder (UITextField-*nameField) via a background tap method, it is

  • 0

When I resign the first responder (UITextField-*nameField) via a background tap method, it is not calling the delegate Method. I am using UIKit with cocos2d. Any help is appreciated. Thank you!

Here is the code with the init Method:

CGRect frame = CGRectMake(115, 423,200, 32);
nameField = [[UITextField alloc] initWithFrame:frame];
nameField.borderStyle = UITextBorderStyleNone;
nameField.textColor = [UIColor blackColor];
nameField.textAlignment = UITextAlignmentLeft;
nameField.font = [UIFont fontWithName:@"MarkerFelt-Thin" size:24];
nameField.placeholder = @"Name";
nameField.backgroundColor = [UIColor clearColor];
nameField.autocorrectionType = UITextAutocorrectionTypeNo;
nameField.delegate = self;
nameField.keyboardType = UIKeyboardTypeDefault;
nameField.returnKeyType = UIReturnKeyDone;
[nameField isFirstResponder];
nameField.transform = CGAffineTransformMakeRotation(M_PI / 2.0);
[[[[CCDirector sharedDirector] openGLView] window] addSubview:nameField];  

And here is the Delegate Method I am calling. I am also conforming to the delegate protocol within the header file.

-(void)textViewDidEndEditing:(UITextView *)textView{


NSLog(@"Name has been saved in NSUserDefauts");

NSUserDefaults *usrDef = [NSUserDefaults standardUserDefaults];
NSString *name = [[NSString alloc]initWithFormat:@"%@",nameField.text];
NSLog(@"%@",nameField.text);
[usrDef setObject:name forKey:@"Name"];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:38:29+00:00Added an answer on May 26, 2026 at 12:38 am

    I think you have the wrong delegate method. The one I think you want is this:

    - (void)textFieldDidEndEditing:(UITextField *)textField
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that I need to tell my UITextField to resign first responder when
I have a UITextView and 2 UITextField set up. UITextView resigns first responder status
I use this code to resign my UITextField as firstResponder when using a standard
-(BOOL) textFieldShouldReturn:(UITextField*) theTextField{ [theTextField resignFirstResponder]; return YES; } it is not working....
Is there a way to detect if a UITextField exists using the Tag property?
Using what I've read online people say put a button in the background of
The ResignFirstResponder for an UITextField on the Iphone semms to not working for the
What's the correct way to resign the current firstResponder? I've seen the following: Looping
I've been using John Resig's getStyle function from Pro JavaScript Techniques to get the
-(void)textFieldDidBeginEditing:(UITextField *)myTextField{ [myTextField resignFirstResponder]; UITextField *tempbtn; tempbtn = myTextField; btntagvalue = tempbtn.tag; if(btntagvalue ==

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.