Lance Toth
Lance Toth

Reputation: 440

Swift non-existent outlet crashes app

I get the following error:

'NSUnknownKeyException', reason: '[<FestiPay.MasterViewController 0x10070ae20> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key cardSection.'

It was an outlet to a TableView section. The problem is, I already removed this variable, and the section doesn't have a Connections Inspector.

How can I remove the reference?

Upvotes: 0

Views: 583

Answers (2)

Suhail kalathil
Suhail kalathil

Reputation: 2693

From storyboard select your view controller, then from the right navigation panel you can get all outlets you made from this view controller. Throughly checking anything is hanging without connection, if you want connect it or delete it.

image

Upvotes: 0

Miknash
Miknash

Reputation: 7948

Go to storyboard, click on MasterViewController then select the outlet tab (last tab in right component). You will see all outlets for the particular view controller and there you can remove hanging references.

The other way could be to right click on the storyboard file, open as source code, search for cardSection and remove nodes from document. With this second approach you have to be very careful since you can break document easily. To verify that you removed it and it is actually working, right click on storyboard again and select interface builder option.

Upvotes: 7

Related Questions