# NSUnknownKeyException: this class is not key value coding-compliant for the key x

**Code:** `NSUnknownKeyException` · **Category:** iOS · **Seen on:** iOS

A storyboard/XIB has a connection to an outlet or action that no longer exists in the class (renamed or deleted), or the view’s custom class is wrong.

## Meaning

Interface Builder stores outlet names. Renaming a property in code without reconnecting, or a wrong Custom Class/Module in the Identity inspector, triggers this when the view loads.

## Common causes

- Outlet renamed/deleted in code but still connected in IB
- Wrong Custom Class on the view controller/view
- Module not set (Inherit Module From Target)

## Quick fix

1. Open the storyboard, right-click the view controller and delete the broken (⚠️) connection
2. Check the Custom Class and Module in the Identity inspector
3. Reconnect the outlet

## Detailed fix by platform

### Xcode

1. `# Storyboard → select view controller → Connections inspector → remove outlets marked with "!"`

## How to diagnose

1. **Key** — Name in the message
2. **Class** — Identity inspector Custom Class

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ios/nsunknownkeyexception-not-key-value-coding-compliant)
