10 Replies
      Latest reply on Oct 10, 2019 8:04 AM by Tlaloc
      Tlaloc Level 1 Level 1 (0 points)

        I added a custom NSBox from the list of UI elements in interface builder to a window in a .xib. If the pop-up menu for custom is selected I can select the margins, frame color and width, etc. But when I run the program XCode reports an error:

         

        2019-10-07 09:55:37.680639-0600 Appname[1291:278976] Failed to set (keyPath) user defined inspected property on (NSBox): [<NSBox 0x1006109a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key keyPath.

         

        This only happens when the Custom popup menu is selected. Is there some way to supress this error? Is this a problem in XCode 11? Can I fix this?

        • Re: NSBox Custom Error Interface Builder
          Claude31 Level 8 Level 8 (6,615 points)

          So, it's an OSX App.

           

          Do you mean customBox or Combo box ? There is no popup in the Custom (unless you add it)

            • Re: NSBox Custom Error Interface Builder
              Tlaloc Level 1 Level 1 (0 points)

              It's a custom box and there is a popup menu item in the Box type field in the attributes pane for NSBox or a NSbox custom. I'm not talking about a box with an additional popup menu added. If the custom attribute - making it a custom box -  is selected with the popup menu you can customize the box but XCode will log the error message when you run the app.

                • Re: NSBox Custom Error Interface Builder
                  Claude31 Level 8 Level 8 (6,615 points)

                  What is the exact type name of the object you draw from the library into the canvas of IB ?

                    • Re: NSBox Custom Error Interface Builder
                      Tlaloc Level 1 Level 1 (0 points)

                      Custom Box. The big project turns it into an NSBox. The test project recognizes it as an NSBoxCustom. Changing it into an NSBoxCustom in the big project using the Custom Class field won't work - XCode reports an Error: Unknown Class. In my test project I can drag a custom box to the window's view, it will be an NSBoxCustom but it and any objects in its view won't be displayed when I run the app. Upgrading to XCode 11.1 didn't fix this.

                • Re: NSBox Custom Error Interface Builder
                  Tlaloc Level 1 Level 1 (0 points)

                  I worked on this some more. When I drag a custom box into my window the from the pane of interface objects in Interface Builder it converts it into an NSBox. I can use the custom option and confugure it. The program runs correctly but logs the error I reported above. I have a small test application that I use to debug various things. In my small test app I can drag an NSBoxCustom into the window, configure it and run the program with no errors. The only way I can get an NSBoxCustom into the app I'm trying to work on is to copy it from the test app and paste it into the window of the main app. I can set its properties and run the app but I get the original error and a second error:

                   

                  2019-10-08 09:46:35.408203-0600 Appname[1377:292177] Unknown class NSBoxCustom in Interface Builder file at path /Users/myName/Library/Developer/Xcode/DerivedData/Appname-hkjlvhmirshcnhesgvusrbzzbezi/Build/Products/Debug/Appname.app/Contents/Resources/Base.lproj/MyDocument.nib.

                   

                  This is pretty weird.  Why would the NSBox and NSBoxCustom classes work in one app's .xib but not another?

                  • Re: NSBox Custom Error Interface Builder
                    Tlaloc Level 1 Level 1 (0 points)

                    More bad news: I opened my test app to see if there was some problem with the XCode settings. - deployment target, etc. Now my test app runs but won't display the NSBoxCustom in its window. This sure looks like a bug in XCode 11.0. Looking at the threads about problems installing XCode 11.1, I'm hesitant to do this.

                    • Re: NSBox Custom Error Interface Builder
                      Tlaloc Level 1 Level 1 (0 points)

                      More bad news: In order to try to solve this problem I deleted the NSBoxCustom from my test app's .xib and add another one. This will display in Interface builder's editor but when I run the application it isn't displayed in the test app window. A put a text cell in the NSBoxCustom's view and ran it again. The text isn't displayed either. It looks like XCode 11 has a bug handling NSBox and NSBoxCustom objects.

                      • Re: NSBox Custom Error Interface Builder
                        Tlaloc Level 1 Level 1 (0 points)

                        More bad news: I upgraded to Mac OS X 10.15 Catalina. When I launched XCode it posted an alert telling me that I needed to download additional components. This is unusual. Generally this happens only when you switch to a newer version of XCode. Now when I run my project XCode logs the unknown object type error and a many errors like this:

                         

                        2019-10-10 08:56:27.540521-0600 appname[3762:35700] [framework] CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: 'com.appname.'