atomicobject / objection

A lightweight dependency injection framework for Objective-C
http://www.objection-framework.org
MIT License
1.85k stars 223 forks source link

getObjectWithArgs arguments ignored in some cases #40

Closed zintus closed 11 years ago

zintus commented 11 years ago

1) Create class with objection_initializer specifying selector and default argument. 2) Bind class to protocol in module spec. 3) Get instance of protocol binded on step 2 from injector with getObjectWithArgs overriding default argument from step 1.

Expected result: object binded to protocol initialized with argument passed on step 3.

Actual result: object initialized with argument specified on step 1 with no respect to values passed on step 3.

jdewind commented 11 years ago

That would be the behavior, yes. Internally, modules use a provider to bind a protocol to a class. There is a todo to "Pass along arguments to providers" which is notated in the README.

zintus commented 11 years ago

Thank you for comment! "Pass along arguments to providers" was a little bit cryptic for me :)

jdewind commented 11 years ago

It certainly isn't obvious. :-) I will see if i can't address this problem in the next week.