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 question.(5)

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

ITtutoria

ITtutoria Logo ITtutoria Logo

ITtutoria Navigation

  • Python
  • Java
  • Reactjs
  • JavaScript
  • R
  • PySpark
  • MYSQL
  • Pandas
  • QA
  • C++
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA
Home/ Questions/Ways to resolve the error - this class is not key value coding compliant for the key
Next
In Process
Mohamed Morin
  • 15
Mohamed Morin
Asked: May 17, 20222022-05-17T13:08:11+00:00 2022-05-17T13:08:11+00:00In: Programs

Ways to resolve the error – this class is not key value coding compliant for the key

  • 15

. Advertisement .

..3..

. Advertisement .

..4..

I get the “this class is not key value coding compliant for the key” issue when trying to link a UILabel with an IBOutlet. Here is the detail of the error I got the error message:

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x6e36ae0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key XXX.'

Please give me some advice to solve this problem.

♦ Suggestions of ITtutoria Team

This is the error that you are making

NSUnknownKeyException', reason: '[<UIViewController 0x3927310> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key string.

Possible causes of this error:

  • Bad Outlet

You either removed, or renamed the outlet name in your .h file. It can be removed in the .xib and .storyboard files’ Connection Inspector.

  • Extension of UIView using bindable property and setting values for those bindable attributes (i.e. shadow, corner radius etc.) Those properties were removed from UIView extension. However, the following <userDefinedRuntimeAttributes> remained unchanged in xml (of foo.storyboard).

Solution:

Right-click on foo.storyboard > Open As Source Code > Search by KeyPath (i.e. ShadowRadius > Delete the </userDefinedRuntimeAttributes> causing the problem

compliant for the key
  • 1 1 Answer
  • 127 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Robert White
    2022-05-26T04:10:25+00:00Added an answer on May 26, 2022 at 4:10 am

    Your xib may be experiencing a poor connection.

    This error has happened to me many times. TechZen’s solution is correct in this instance. However, there is another common cause: changing the name of an IBOutlet property within your.h/.m that you have already connected to File’s owner in the nib.

    From your home:

    1. Click on the object you want to view in IB, then go to the “Connections Inspector”.
    2. Check under ‘Referencing Outlets’ to make sure your object isn’t still linked to an old property name. Click the small x’ to delete this reference and rebuild again.


      this%20class%20is%20not%20key%20value%20coding%20compliant%20for%20the%20key

    If you use Storyboard, another common problem is that your UIButton may have multiple assignings. (Solution works almost exactly the same way as nib).

    1. Right click on the UIButton in your storyboard.
    2. This button has more than one assign/ref. You can remove one of the “Main …” greyed Windows with the small “x”.


      this%20class%20is%20not%20key%20value%20coding%20compliant%20for%20the%20key

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

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question
  • How to Split String by space in C++
  • How To Convert A Pandas DataFrame Column To A List
  • How to Replace Multiple Characters in A String in Python?
  • How To Remove Special Characters From String Python

Explore

  • Home
  • Tutorial

Footer

ITtutoria

ITtutoria

This website is user friendly and will facilitate transferring knowledge. It would be useful for a self-initiated learning process.

@ ITTutoria Co Ltd.

Tutorial

  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA

Legal Stuff

  • About Us
  • Terms of Use
  • Privacy Policy
  • Contact Us

DMCA.com Protection Status

Help

  • Knowledge Base
  • Support

Follow

© 2022 Ittutoria. All Rights Reserved.

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.