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 6709861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:55:56+00:00 2026-05-26T07:55:56+00:00

I am a newbie to this Xcode stuff. Details of my error: 1) I

  • 0

I am a newbie to this Xcode stuff.

Details of my error:

1) I started with utility application in Xcode

2) In my MainView.xibI placed a text field. and linked it to code the easy way.(just dragging in to my MainViewController.h file. ..which declared it and even set both property and synthesize for it.)

3) Now when i run the program .. I see my textfield..I press in it..Keyboard come up… and when i try to type in ..just after 1 or 2 letters it runs an error in UIApplicationMain saying EXC_BAD_ACCESS. I searched it for quite some time and somewhere here only on stack overflow I found a solution to change correction in textField to no .. which solves it… This is not my main problem .. but I want to confirm if this method is okay to keep doing in future….sometime in future I will want to have correction enabled.

4) My main problem is that I want to have my textfield keyboard pop in back when user presses return key on the keyboard.
I used this method ..
and you can see it I tried several ways to do it .. to check for various methods.

-(BOOL) textFieldShouldReturn:(UITextField *)textField {    
    // if([textField becomeFirstResponder]) {
    NSLog(@"IN FINCTION");
    [textField resignFirstResponder];
    return YES;
}

The program was run with both lines commented and not commented but still every time it hits the end of the function it takes me to the the same error in UIApplicationMain: EXC_BAD_ACCESS.

Also, I did enable zombies but i am not sure if i did it correctly so if any of you guys want info on that.

I checked the code on different version of Xcode.. one was normal and other one was GM.

The console shows the log of IN FUNCTION.

Thanks

  • 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-26T07:55:57+00:00Added an answer on May 26, 2026 at 7:55 am

    You would want to return NO from that method because the way you have it now, you are removing focus (and the cursor) from the textField, but then indicating that you DO want to process the return button. But since you have resigned first responder, there is noone to process the return button being pressed.

    Try this:

    -(BOOL) textFieldShouldReturn:(UITextField *)textField {    
        [textField resignFirstResponder];
        return NO;
    }
    

    From UITextFieldDelegate Protocol docs:

    textFieldShouldReturn:

    Asks the delegate if the text field should process the pressing of the return button.


    If the above doesnt work try this:

    Set NSZombieEnabled, MallocStackLogging, and guard malloc in the debugger. Then, when your App crashes, type this in the gdb console:

    (gdb) info malloc-history 0x543216
    

    Replace 0x543216 with the address of the object that caused the crash, and you will get a much more useful stack trace and it should help you pinpoint the exact line in your code that is causing the problem.

    See this article (how-to-debug-exc_bad_access-on-iphone) for more detailed instructions.


    If the above also doesnt work try this:

    You might also want to try turning off “Auto-Correction” in the simulator keyboard settings. There is a bug in one of the versions of the simulator that can cause a crash when you try to enter text in a text field.

    Simulator

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

Sidebar

Related Questions

I'm a newbie to this linq stuff. I never used any linq before. So
I am a newbie in this field so please excuse my silly mistakes :)
How can I use memcache in Joomla? I'm a newbie in this field so
I'm a newbie to all this ASP.NET MVC stuff, and I was making some
Newbie question here ... I've created a Master-Detail Application project in Xcode 4.2 using
I am a newbie in this field. I have a sharepoint list containing a
this newbie here is smacking his head with webservices over Rails. Perhaps someone could
Sorry for this newbie question, but I can't find on google what I need
I'm trying to solve this newbie puzzle: I've created this function: def bucket_loop(htable, key):
Firstly: I am totally a newbie for this kind of work. I have a

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.