Xib labels referenced in another viewcontroller

Viewed 112

This is the error message I get: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key nameLabel.' The below explains how it differs from the other questions posted. Since I am actually following the instructions from the link provided.

I have linked the Xib as follows: The ViewController I would like to use is MapViewController. The Xib is MarkerInfoView The file owner is MapViewController and it's also where I have created the outlets.

enter image description here

3 Answers

i think that this happens becouse when you register your xib with a fileowner it maybe recreated and the outlets are disconeccted automaticlly. i don't use that way of registring nibs

For using xibs initialize with MapInfo(nibName: "XibName", bundle: nil)

Other possible thing is that your outlets actually connected to mapinfoview, not controller. Delete them and recreate onto your viewcontroller

Related