0
votes

I got this error by trying to hack my way to adding UI elements to a popup on Xcode by just drawing UI components onto the view from Xcode's Storyboard:

2019-06-19 17:48:07.215803-0400 FileVacuum[28312:2252972] [General] *** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (AMPathPopUpButton) for key (NS.objects); the class may be defined in source code or a library that is not linked
2019-06-19 17:48:07.222794-0400 FileVacuum[28312:2252972] [General] (

Xcode Main.storyboard screenshot

I happily drew out my app in Xcode, built it, and saw the error above when I tried to trigger the popup with the newly added Main.storyboard UI elements inside.

1

1 Answers

0
votes

To satisfy this error and get your popup's UI elements building/showing takes two simple steps:

  1. Add the "Automator.framework" in your project's "General" setting page. See this answer here: https://stackoverflow.com/a/25667439/1762493
  2. Then be sure to link the elements in your popup to an @IBOutlet variable like so: @IBOutlet var imgPath: NSPathCell!. Once you add the @IBOutlet var you have to drag your mouse and connect it to the UI element. You'll need an @IBOutlet or @IBAction for each element you drew in the Main.storyboard like so:

Xcode screenshot dragging IBOutlet variable to Main.storyboard UI element

There's a good tutorial at RayWenderlich.com for creating a popup and adding UI elements connected to Main.storyboard for MacOS apps here:

https://www.raywenderlich.com/450-menus-and-popovers-in-menu-bar-apps-for-macos