I am getting this weird error

I am an aspiring developer and would like some help with this issue, that is super annoying.
Any Idea why I am getting this message?

Thread 1: “[<UIViewController 0x7ff3bdc08a80> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key leadingHome.”

I have tried:

  1. Deleting home and re-adding it
  2. reconnecting all the points on the home controller
  3. Deleting the class and re-adding it
  4. Making a new class and changing Home over to it
  5. Setting the constraints and menu button itself to the class

You can download my project at: https://www.icloud.com/iclouddrive/0vC-WfbeKKjLa6V05ofqhyayw#Riddle_Wednesday

Thanks so much in advance!

From the Project Navigator (the pane on the left) select Main.storyboard.

In the Document Outline, select ViewController and over on the right hand Inspector panel choose “Show the connections inspector”

Look for any entries on that panel that have an amber triangle on the right hand edge which indicates that the connection is broken. Delete that entry by tapping on the little x immediately to the left and re-create the outlet or action.

I deleted viewController, because I had a swift file for every page individually. Can you please take a look at the project? Also, there are no weird or broken connections.

You need to compress the project into a single zip file at the root project level so that all I do is download a single file. In other words, where you find your ProjectName.xcodeproj, go back up one level and select that folder and compress it.

Post that zip file preferably to DropBox because the iCloud method is just too awkward to have to log in, go through the two factor authentication process, add your folder to my iCloud Drive… seriously, DropBox is just way easier.

Post it to your Dropbox instance and then create a share link and post here in a reply.

Does google drive work?

Here is the link: https://drive.google.com/file/d/1IPAnnuTaZmaDU3P27S5FQAEia1NG3Ac2/view?usp=sharing

Yes, that’s OK. Let me have a look.

1 Like

So for whatever the reason it hates the fact that you have created an outlet to a constraint named leadingHome. I’m guessing the intent is to animate the leading edge of the View to the right by 150 points. (Same with the trailing edge I assume) It seems reasonable but what is the point of animating that view left and right anyway? Is it to allow the stackView containing the buttons to be visible?

It’s late here so I am going to crash for the night. I’ll have a look in the morning.

ok, but yes, you got it exactly right! However, if i disconnect that, it then complains about trailingHome or menuTappedHome

I thought that would be the case. It’s a runtime error that is occurring and I can’t figure out why… yet.

1 Like

What time zone are you on?

GMT +8, you should be able to see that if you tap on my username.

Someone on the devs forum helped, and it’s fixed!

And as far as I checked your Main.storyboard, almost all the Custom Class settings are broken.
For example, your Home Scene:

Code Block Class  [Home                        ]Module [None                        ] //<- This should not be `None` for Swift classes       [ ] Inherit Module From Target

Module of Swift classes need to be set to your AppModuleName. Usually when you check on Inherit Module From Target , Xcode will do it.

Code Block Class  [Home                        ]Module [Riddle_Wednesday            ]       [v] Inherit Module From Target

You may need to re-check the Custom Class settings of all the view controllers (and all other components using custom Swift class).

That was well spotted by the other guy. The classes automatically inherit from the parent class (UIViewController) so you would never need to change that unless you had a specific reason to do so.

I guess you won’t make that mistake again. :stuck_out_tongue_winking_eye:

1 Like