Unrecognized selector sent to instance on click
<p>Everytime I run my app and click my facebook log in button it crashes due to error:</p>

<pre><code>##Error 
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController facebookbutton:]: unrecognized selector sent to instance 0x7fce2b700360'
</code></pre>

<p>My view controller has a button(facebookbutton) which is suppose to open up the facebook log in url.</p>

<pre><code>##My code for the button
@IBAction func facebookbutton(_ sender: Any) {
    FBSDKLoginManager().logIn(withReadPermissions: ["email", "public_profile"], from: self) {
        (loginResult: FBSDKLoginManagerLoginResult?, error: Error?) in
        if error != nil {
            print("Custom FB Login Failed:", error!)
            return
        }
    }
}
</code></pre>

<p>The error pops up in app delegate
<a href="https://i.stack.imgur.com/XISWu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XISWu.png" alt="enter image description here"></a></p>

<p>I've tried searching if i messed up the outlets and even tried making a new button. I'm still getting the error. Is there a way to solve this?</p>