Skip to main content

Command Palette

Search for a command to run...

Unexpectedly found nil when unwrapping an optional

Published
1 min readView as Markdown

This happens if you are using a storyboard / nib / xib file, and you accidentally register a nib when you meant to register a non-nib file.

Take a look:

register(T.self, forCellReuseIdentifier: T.dequeueIdentifier)
register(UINib(nibName: T.dequeueIdentifier, bundle: nil), forCellReuseIdentifier: T.dequeueIdentifier)

Those are two different functions - make sure you choose the correct one

6 views

More from this blog

CoderLyn's developer journey

136 posts

I'm an iOS developer, helping millennials with their finances through US neo-bank, Empower.

Before making the switch to development, I was a strategist and GM in the tech space.