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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:07:08+00:00 2026-06-09T20:07:08+00:00

Ok so basically i’m extremely new to this, been doing it about 3 days

  • 0

Ok so basically i’m extremely new to this, been doing it about 3 days now. I have been reading through ‘IPhone Application Development for Dummies’ and have been building a tutorial app. I have just added code to handle view scrolling when the keyboard comes up but i am getting the aforementioned error. I know what line of code is causing it but i have no idea how to fix it.
Here is some of the code:

ViewController.h

    #import <UIKit/UIKit.h>

    @interface ViewController : UIViewController

    @property (retain, nonatomic) IBOutlet UITextField * textField;


    @property (retain, nonatomic) IBOutlet UILabel *lbl;


    @end

ViewController.m

    #import "ViewController.h"

    @interface ViewController ()

    @end

    @implementation ViewController;
    @synthesize lbl;
    @synthesize textField;

    - (void)viewDidLoad:(BOOL)animated
    {
       [super viewDidLoad];
    }
    - (void)viewWillAppear:(BOOL)animated  {

        [[NSNotificationCenter defaultCenter] addObserver: self
    selector:@selector(keyboardWillShow:) //pretty sure its this line causing issues
    name:UIKeyboardWillShowNotification
    object:self.view.window];
      [super viewWillAppear:animated];

    }





    -(void)viewWillDisappear:(BOOL)animated  {
       [[NSNotificationCenter defaultCenter] removeObserver:self name:                                                                                 UIKeyboardWillShowNotification object: nil];
  [super viewWillDisappear:animated];
       }
    // Do any additional setup after loading the view, typically from a nib.


    - (void)viewDidUnload
    {

[self setLbl:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
    }

    - (BOOL)shouldAutorotateToInterfaceOrientation:        (UIInterfaceOrientation)interfaceOrientation
    {
        if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
            return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
        } else {
    return YES;
        }
    }

    - (void)dealloc {
[lbl release];
[textField release];
[super dealloc];
    }
    @end

The error message in debug console is

    2012-08-08 10:48:56.873 tester[552:c07] -[ViewController keyboardWillShow:]:         unrecognized selector sent to instance 0x6a5f6b0
    2012-08-08 10:48:56.875 tester[552:c07] *** Terminating app due to uncaught exception         'NSInvalidArgumentException', reason: '-[ViewController keyboardWillShow:]: unrecognized         selector sent to instance 0x6a5f6b0'
    *** First throw call stack:
    (0x14b2022 0xeb2cd6 0x14b3cbd 0x1418ed0 0x1418cb2 0x9d7a29 0x147d855 0x147d778 0x91c19a 0x3ab4cb 0x3a6906 0x3a851f 0x3a85a9 0x3a85f3 0x3a2938 0x103678 0x10312e 0x2e28fb 0x2e45f8 0x2dce29 0x2dc133 0x2dd3bf 0x2dfa21 0x2df97c 0x2d83d7 0x3d1a2 0x3d532 0x23dc4 0x17634 0x139cef5 0x1486195 0x13eaff2 0x13e98da 0x13e8d84 0x13e8c9b 0x139b7d8 0x139b88a 0x15626 0x26b2 0x2625)
    terminate called throwing an exception(lldb) 

Can anyone help me?

  • 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-09T20:07:09+00:00Added an answer on June 9, 2026 at 8:07 pm

    You don’t have a method called keyboardWillShow:, so it’s a bit like giving a friend an address that doesn’t exist, and him having a tantrum when he can’t find it (and crashing).

    To fix this just add something like;

    - (void)keyboardWillShow:(id)sender { }

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

Sidebar

Related Questions

Basically, I have a UIImageView that will loop through 8 PNGs over 0.5 seconds.
Basically, I have a list of delivery checkboxes one for deliver to this address
Basically I have a loop incrementing i, and I want to do this: var
Basically, the reverse of abs. If I have: if ($this.find('.pdxslide-activeSlide').index() < slideNum - 1)
Basically I have this server app I built in vc#, and for some reason
Basically I have a large set of data in excel, and I was wondering
Basically what I am doing is giving a user a list of terms via
Basically from a database I am getting data that is formatted like this nameofproject101
Basically I'm attempting to add rows to a table, I need to do this
Basically I have an iframe loaded that is accessed from the parent whenever it

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.