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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:30:26+00:00 2026-05-12T19:30:26+00:00

I get a crazy error and I am unable to see why it happens.

  • 0

I get a crazy error and I am unable to see why it happens.
I have made a simple app that uses a TabBar to navigate 3 views. I created everything and added one UIImageView to each of the 3 ViewControllers that the TabBar manages. Everything works fine. In the app you are able to navigate the 3 views and see the 3 images.

Now I add one UIButton (or any other component) to the 1st ViewController. I add it in the NIB and in my code I do the usual:

IBOutlet UIButton *btn;
@property (nonatomic, retain) IBOutlet UIButton *btn;

@synthesize btn;
[btn release];

and connect the UIButton in my NIB to the “btn”. Now the app crashes as soon as the TabBar tries to show this view (which is imediately after it launches) giving me a:

2009-08-24 16:52:25.164
AppName[2249:207] *** Terminating app
due to uncaught exception
‘NSUnknownKeyException’, reason:
‘[
setValue:forUndefinedKey:]: this class
is not key value coding-compliant for
the key btn.’

I tried restarting the SDK, my computer, building for 2.2.1, 3.0, for simulator, for device, cleaning all targets, etc but the problem remains. I am sure it has something to do with the UITabBarController. I just can’t see what.

  • 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-12T19:30:27+00:00Added an answer on May 12, 2026 at 7:30 pm

    I had a similar problem. It was because the UIViewController for the tab was not set to the specific subclass of UIViewController I had created.

    If you look at the .xib in IB you’ll see something like this:

      **Name**                **Type**
      File's Owner        UIApplication
      First Responder     UIResponder
      Tab Bar Controller  UITabBarController
         Tab Bar          UITabBar
         View Controller  UIViewController
         View Controller  UIViewController
         View Controller  UIViewController
    

    The View Controllers under the tab bar controller will default to a basic UIViewController. You need to change their class to your subclassed view controller in order for them to load and connect to your outlets correctly:

      **Name**                **Type**
      File's Owner        UIApplication
      First Responder     UIResponder
      Tab Bar Controller  UITabBarController
         Tab Bar          UITabBar
         FirstTab View Controller  MyFirstTabController
         SecondTab View Controller MySecondTabController
         ThirdTab View Controller  MyThirdTabController
    

    Then when the tab creates the controller for your tab it will be creating the correct class. Note, this is probably why your viewDidLoad method is not called

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

Sidebar

Related Questions

I've been driving myself crazy trying to get the Entity Framework to work as
We get the following error; The request was aborted: Could not create SSL/TLS secure
I get an Access is Denied error message when I use the strong name
I get the following error when running my Visual Studio 2008 ASP.NET project (start
I get the following error when building my Windows Forms solution: LC.exe exited with
I get this error: Can't locate Foo.pm in @INC Is there an easier way
I get the following error when trying to run the latest Cygwin version of
We get a large amount of data from our clients in pdf files in
I get a URL from a user. I need to know: a) is the
I get an XML file From a web service. Now I want to get

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.