Thread error message

I keep in getting these messages when I click on one of the items on my menu tab. Not sure what it is referring to.

Thread 1: “-[fruggienew.MenuBarTableViewController contactUs:]: unrecognized selector sent to instance 0x7fd96ed2b1e0”

in the debug area I got these: ***** First throw call stack:**
(
with 29 lines of them

I think you need to post some code to show what you are tying to do.

Paste your code in as text, rather than providing a screenshot.

To format the code nicely, place 3 back-ticks ``` on the line above your code and 3 back-ticks ``` on the line below your code. The 3 back-ticks must be the ONLY characters on the line. The back-tick character is located on the same keyboard key as the tilde character ~ (which is located below the Esc key). You can also highlight an entire code block and click the </> button on the toolbar to wrap the block for you.

This also makes it easier for anyone assisting as they can copy the code and carry out some testing.

import Firebase



@main
class AppDelegate: UIResponder, UIApplicationDelegate {



    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        
        FirebaseApp.configure()
        
        return true
    }

    // MARK: UISceneSession Lifecycle

    func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
        // Called when a new scene session is being created.
        // Use this method to select a configuration to create the new scene with.
        return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
    }

    func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
        // Called when the user discards a scene session.
        // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
        // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
    }


}

this is where the thread error message is opening up on the appdelegate.swift file . it shows up right next to the “@main

Other then this code I haven’t really coded anything other then linking each button on the menu to the editor (“control”, click, and drag to create an IBAction outlet in the menu bar swift file

At a guess the cause of the crash is with code elsewhere in your App. I’m also guessing that it is a UIKit Application and you have configured some objects in your Main.storyboard and have connected (or attempted to connect) the objects to your ViewController.

Since you have also added pods to your project the next question is have you made sure that you have opened the project via the .xcworkspace file rather than the .xcodeproj file?

(edit)
It’s also rather late where I am so perhaps someone else might assist while I get some sleep.

Oh ok, yes it is a UIKit and I have tried to connect buttons to the specific view controller. I can send a screen shot of what my main story board looks like if that helps.

Oh ok no problem have a good night.

If this is the error you are getting:

Thread 1: “-[fruggienew.MenuBarTableViewController contactUs:]: unrecognized selector sent to instance 0x7fd96ed2b1e0”

then you should look at wherever it is you are calling a function named contactUs on a UITableViewController. And post the code for that UITableViewController.

I deleted all the connections and re-connected them and that solved the problem. Thank you so much!

1 Like