Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIViewController not key value coding-compliant #29

Closed
thomas-oo opened this issue Dec 13, 2016 · 10 comments
Closed

UIViewController not key value coding-compliant #29

thomas-oo opened this issue Dec 13, 2016 · 10 comments

Comments

@thomas-oo
Copy link

I'm getting an exception when I try to switch to a pulleyViewController

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x143d485f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key drawerContentContainerView.

As per instructions, I added two container views in the pulleyviewcontroller and linked the outlet drawerContentContainer to a container view. And, I also linked the outlet primaryContentContainer to the other container view. These two container views segue to ordinary UIViewControllers.

I did not do any customization but I am getting this exception. My project is primilary objective-c but I don't think this has much to do with it. I even tried to use a forked project https://github.com/tadelv/Pulley/tree/objc_friendly but the exception still arises.

TLDR: followed insturctions to setup PulleyViewController in interface builder, NSUnknownKeyException arises

@amyleecodes
Copy link
Contributor

It looks like you haven't set the subclass of the view controller to "PulleyViewController" in your Storyboard.

If you had, this would say "PulleyViewController" instead of "UIViewController":

'[<UIViewController 0x143d485f0> setValue:forUndefinedKey:]:

Checkout the example project in the main repo for a working example.

@thomas-oo
Copy link
Author

I finally got it!
I did subclass the view controller to PulleyViewController but when I checked your demo project, I noticed the module was Pulley and that I hadn't set a module in my project. I set the module to Pulley and voila, it worked! I guess if you don't set the module, it can't find the PulleyViewController?

Anyways I'm so happy, I've been wanting to make this work for so long! great work on this and cheers

@amyleecodes
Copy link
Contributor

Ah! That would do it! Nice find. Let me know if you have any questions.

@alexbartisro
Copy link

Just realised this 3 seconds before finding this thread. Maybe this piece of info is worth to be added to the Readme?

@funkenstrahlen
Copy link

Stumbled across this problem too. Would never have found the solution without finding this.

@amyleecodes
Copy link
Contributor

Added a note about this (with a link to the issue) to the Interface Builder section of the README. Thanks for the heads up everyone!

@amyleecodes
Copy link
Contributor

@alpa99 Please make a new issue and I can assist you there. Posting in this issue isn’t on topic.

@mickmgit
Copy link

Xcode 9.1.4, latest version of Pulley. If I have the Module as Pulley, I get:

Unknown class _TtC6Pulley20PulleyViewController in Interface Builder file.

If I set the Module to None, I get:

Unknown class PulleyViewController in Interface Builder file.

Both situations crash.

If I check "Inherit Module From Target", then it works.

@amyleecodes
Copy link
Contributor

amyleecodes commented Sep 25, 2018

That is an expected Interface Builder behavior, and not related to Pulley.

@mickmgit
Copy link

mickmgit commented Sep 25, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants