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

  • Home
  • SEARCH
  • 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 8014917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:05:34+00:00 2026-06-04T20:05:34+00:00

I was wondering if you could help me. I want to create a situation

  • 0

I was wondering if you could help me.

I want to create a situation where if a user enters a specific text in a textfield – they are taken to a new view.

I am struggling to get this to work – I use the following code to instigate this:

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{

if ([string isEqualToString:@"\n"]) {

    NSString *lowercaseactualanswer = [footballersurname lowercaseString];
    NSString *lowercaseuseranswer = [textField.text lowercaseString];

    if ([lowercaseuseranswer isEqualToString:lowercaseactualanswer])
    {

        CorrectScreen *screen = [[CorrectScreen alloc] initWithNibName:nil bundle:nil];
        screen.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
        [self presentModalViewController:screen animated:YES];   
    }
    else {
        self.guess.text = [[NSString alloc]initWithFormat: @"%@ is incorrect", textField.text]; 
        textField.text = @"";    
    }

}
return YES;

}

and I have used the same method to navigate to different screens elsewhere in my code with success (using the same method as from the three lines from CorrectScreen *screen) The error message I receive is:

-[GameScreen textFieldDoneEditing:]: unrecognized selector sent to instance 0x6c43e20

and when adding an exception breakpoint – the green arrow stops at the line starting [self presentModal….] with the thread highlighting the following:

-[GameScreen textField:shouldChangeCharactersInRange:replacementString:]

I don’t really know where the problem lies. I was under the impression that an unrecognised selector problem usually relates to not linking up objects correctly but I am certain I have that done here.

Does anyone have any ideas? I am a bit stuck at the moment and I’m sure someone out there can help!

Thanks very much!

Andy

  • 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-06-04T20:05:35+00:00Added an answer on June 4, 2026 at 8:05 pm

    I suspect that what happens is the following:

    1. you are in a text field;

    2. when the field content changes, you present a modal view;

    3. presenting a modal view will try to end the edit session by sending textFieldDoneEditing to your GameScreen object;

    4. textFieldDoneEditing is not defined for GameScreen, so your program crashes.

    The fix is defining that method for your class.

    Since textFieldDoneEditing is not part of the iOS SDK (as far as I can see), I assume that you defined it in Interface Builder to be an action that is fired by your textfield “Editing Did End” event. You could also appropriately modify this binding so fix the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to php and was wondering if anybody could help me with
Wondering if someone could help me. I have next to no knowledge with Ajax,
Just wondering if you could help wanting to produce an activity stream in Java,
Just wondering if someone could help me with a very simple SQL query. I
I was wondering if anyone could help me implement color selection in my iOS
I was wondering if anybody could help me with a method of creating a
I was wondering if somebody could help me with how exactly to write some
I was wondering if someone could help me with this. I have defined my
Hey there, was wondering if anyone could help a newbie on SQL and Python.
Python neophyte here. I was wondering if someone could help with the KeyError I

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.