Latcie
Latcie

Reputation: 701

Referencing outlet file's owner

I can't figure out why it's crashing with "this class is not key value coding-compliant for the key profilePic" in this picture.

enter image description here

Upvotes: 0

Views: 1566

Answers (1)

Paulw11
Paulw11

Reputation: 114875

With storyboard scenes, the view controller instance class is set by the custom class assigned to the view controller scene. With NIB files you are responsible for initialising the correct class instance yourself:

Rather than

let initialViewController = UIViewController.init(nibName: "InitialViewController", bundle: nil) as! InitialViewController

You need to have

let initialViewController = InitialViewController(nibName:"InitialViewController". bundle: nil)

Upvotes: 2

Related Questions