0

Description

So I decided to fire up my app once more, after doing a clean and reinstall, and found that I was getting a crash that would send me to a "Thread 1: signal SIGABRT" at the top of the AppDelegate.swift file. The error occurred when I was simply navigating through views, via buttons that show(push) on to the stack. I even tried commenting out the functions on the view that I was trying to reach, in order to insure that it wasn't a function throwing an error for some reason. Below, I will attach some code snippets connected with the view I am trying to reach and the view that I am currently on. Sorry if this seems vague. It is just a very vague issue I am running into.

Code

class back4: UIViewController, UITextFieldDelegate{

@IBOutlet weak var no: UIButton!
@IBOutlet weak var yes: UIButton!
@IBOutlet weak var distance: UITextField!
override func viewDidLoad() {
    super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
}
/*
@IBAction func save(_ sender: AnyObject) {
    let appDel:AppDelegate = (UIApplication.shared().delegate as! AppDelegate)
    let context:NSManagedObjectContext = appDel.managedObjectContext
    let entity1 = NSEntityDescription.insertNewObject(forEntityName: "CrawlerOne", into:context) as NSManagedObject as! CrawlerOne
    entity1.crawlerDistance = distance.text

}
@IBAction func yes(_ sender: AnyObject) {
    let appDel:AppDelegate = (UIApplication.shared().delegate as! AppDelegate)
    let context:NSManagedObjectContext = appDel.managedObjectContext
    let entity1 = NSEntityDescription.insertNewObject(forEntityName: "CrawlerOne", into:context) as NSManagedObject as! CrawlerOne
    entity1.crawlerAbrasion = "yes"
}
@IBAction func no(_ sender: AnyObject) {
    let appDel:AppDelegate = (UIApplication.shared().delegate as! AppDelegate)
    let context:NSManagedObjectContext = appDel.managedObjectContext
    let entity1 = NSEntityDescription.insertNewObject(forEntityName: "CrawlerOne", into:context) as NSManagedObject as! CrawlerOne
    entity1.crawlerAbrasion = "no"

}
*/
@IBAction func back(_ sender: AnyObject) {
    if let navController = self.navigationController {
        navController.popViewController(animated: true)
    }
  }
}
  • ^ This is the code for the view that I am trying to reach, via a show segue connected to a button*

    class back3: UIViewController, UITextFieldDelegate{
    
    override func viewDidLoad() {
        super.viewDidLoad()
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    @IBAction func back(_ sender: AnyObject) {
        if let navController = self.navigationController {
          navController.popViewController(animated: true)
       }
      }
    }
    

^ This is the code attached to the view I am currently at

Recap

Again, I don't get any error messages besides the "Thread 1: signal SIGABRT" at the top of AppDelegate.swift. I've also already checked for accidental multi-segue'd buttons, because I know I've accidentally done that in the past. I am using swift 3 and xcode 8.0

Debugger Console

2016-08-04 10:05:32.239 Prototype Inspection[9292:4560823] CUICatalog: Invalid asset name supplied

2016-08-04 10:05:32.241 Prototype Inspection[9292:4560823] Could not load the "" image referenced from a nib in the bundle with identifier "Wirtgen.Prototype-Inspection"

2016-08-04 10:05:33.732 Prototype Inspection[9292:4560823] CUICatalog: Invalid asset name supplied:

2016-08-04 10:05:33.733 Prototype Inspection[9292:4560823] Could not load the "" image referenced from a nib in the bundle with identifier "Wirtgen.Prototype-Inspection"

2016-08-04 10:05:34.609 Prototype Inspection[9292:4560823] CUICatalog: Invalid asset name supplied:

2016-08-04 10:05:34.610 Prototype Inspection[9292:4560823] Could not load the "" image referenced from a nib in the bundle with identifier "Wirtgen.Prototype-Inspection"

2016-08-04 10:05:35.981 Prototype Inspection[9292:4560823] Unknown class back4 in Interface Builder file.

2016-08-04 10:05:36.010 Prototype Inspection[9292:4560823] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key distance.'

*** First throw call stack:

(0x180a42db0 0x1800a7f80 0x180a42a70 0x18134f6e4 0x185f15de8 0x186078eb0 0x180966888 0x186077898 0x185f19230 0x185cde118 0x185ba08ec 0x185bb90d0 0x185d53e5c 0x185c5fe40 0x185c5fb1c 0x185c5fa84 0x185b9c1e4 0x18352e994 0x1835295d0 0x183529490 0x183528ac0 0x183528820 0x185b9eff4 0x1809f909c 0x1809f8b30 0x1809f6830 0x180920c50 0x182208088 0x185c0a088 0x1000ad4c8 0x1804be8b8)

libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

MSU_Bulldog
  • 3,501
  • 5
  • 37
  • 73
gavsta707
  • 365
  • 3
  • 16
  • What does the debugger console say? – BaseZen Aug 04 '16 at 14:57
  • These errors might involve the Storyboard since you don't have explicit in-code `push` segues. Can you upload the entire project somewhere? – BaseZen Aug 04 '16 at 14:58
  • This debug console says: *** First throw call stack: (0x180a42db0 0x1800a7f80 0x180a42a70 0x18134f6e4 0x185f15de8 0x186078eb0 0x180966888 0x186077898 0x185f19230 0x185cde118 0x185ba08ec 0x185bb90d0 0x185d53e5c 0x185c5fe40 0x185c5fb1c 0x185c5fa84 0x185b9c1e4 0x18352e994 0x1835295d0 0x183529490 0x183528ac0 0x183528820 0x185b9eff4 0x1809f909c 0x1809f8b30 0x1809f6830 0x180920c50 0x182208088 0x185c0a088 0x1000ad4c8 0x1804be8b8) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) – gavsta707 Aug 04 '16 at 15:06
  • and i would be willing to privately share the project, but i wouldn't be able to have a public link since it is a company project @BaseZen – gavsta707 Aug 04 '16 at 15:07
  • There's probably more in the debug console above that. Add all of it to the question. – BaseZen Aug 04 '16 at 15:08
  • I edited it @BaseZen. Sorry, i didn't see the other errors because my window was too small – gavsta707 Aug 04 '16 at 15:10
  • Check that you have referenced your textField @IBOutlet weak var distance: UITextField! to your viewController and on storyBoard – Reinier Melian Aug 04 '16 at 15:12
  • It shows that it is still a referencing outlet to the correct class @ReinierMelian – gavsta707 Aug 04 '16 at 15:14
  • This is the key of the problem: `Unknown class back4 in Interface Builder file` So there's a linkage problem, as if back4 is not getting compiled into your module. Is it in a framework or other module? You might try the usual quit Xcode / `rm -rf ~/Library/Developer/Xcode/DerivedData` and restart and rebuild. – BaseZen Aug 04 '16 at 15:17
  • I will try that. And back4 is just a class in my "back.swift" file. Everything used to work just fine. – gavsta707 Aug 04 '16 at 15:19
  • You have one outlet named `distance` referenced from storyboard but deleted on your viewController class this is the cause of this crash – Reinier Melian Aug 04 '16 at 15:20
  • In my viewController, @IBOutlet weak var distance: UITextField! is still connected to the distance text field, as is shown under the connection inspector for the outlet. – gavsta707 Aug 04 '16 at 15:25
  • Did you copy back4ViewController from back3ViewController? – Reinier Melian Aug 04 '16 at 15:27
  • Try the possibilities in http://stackoverflow.com/questions/24924966/xcode-6-strange-bug-unknown-class-in-interface-builder-file This is the core of the issue to focus on. It looks like these annoyances are still left over from Xcode 6. In general, mess with the identity inspector of your back4 Storyboard VC to ensure that `back4` is indeed recognized and auto-completed by Xcode. – BaseZen Aug 04 '16 at 15:27
  • You're a genius! That actually solved the issue. That is such a strange bug. Thank you @BaseZen – gavsta707 Aug 04 '16 at 15:33

1 Answers1

0

The view controller that you're navigation to has an outlet for distance hooked up in the storyboard, but a distance property doesn't (or no longer) exists on the destination view controller's class. It says that no back4 class could be found. Make sure that in the view controller's identity inspector, it has the correct module set below the class name. Sometimes Xcode fails to infer the correct module, and you have to set it manually.

NRitH
  • 13,441
  • 4
  • 41
  • 44