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

Injecting object with protocol and superclass #85

Open
WiesnerPeti opened this issue Jan 26, 2015 · 0 comments
Open

Injecting object with protocol and superclass #85

WiesnerPeti opened this issue Jan 26, 2015 · 0 comments

Comments

@WiesnerPeti
Copy link

Excuse me if this issue was reported before (tried to check all the open or closed issues) or this issue is due to my lack of understanding of DI.

I'm trying to bind a class to a protocol like this (ViewController conforms to ViewInterface):

[module bindClass:[ViewController class] toProtocol:@protocol(ViewInterface)];

I also have an object, that has a property like this:

@property (nonatomic, strong) UIViewController<ViewInterface>* viewController;

This object also registers for property injection:

objection_requires(@"viewController")

My problem:
The viewController won't be injected, because the FindClassOrProtocolForProperty static function in JSObjectionUtils tries to search for a protocol of UIViewController and not ViewInterface.

Is it a bug, or just the result of wrongly using the framework?

Thank you for the answer in advance!

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

No branches or pull requests

1 participant