-
Notifications
You must be signed in to change notification settings - Fork 223
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
equivalent to @Named injections #66
Comments
Interesting idea. You can statically declare NSDictionary data structures? I thought NSString's were still the only place where that was supported. |
Objective-C has had object literals since mid 2012 (Clang 4, XCode 4.4, not As for the @nAmed, I keep meaning to play with it, I think I'd like to @Property (weak, nonatomic) FileIOType* configFile; // Gets a singleton objection_requires_names(@{"FileIO.configFile": @"configFile"}); which If I get the time I may float a prototype for feedback. On Mon, Mar 3, 2014 at 8:00 AM, Justin DeWind [email protected]:
|
I understand that it has had literals. But my understanding is that they can not be used statically. |
Actually, concern about the structured being available statically is irrelevant. They are passed to a macro that generates a selector. The context would never be static. |
A dictionary can be passed to a macro, but the syntax is a little unusual, as it requires double parentheses:
I have written an implementation of named bindings. It does not handle config files, but it will allow for separate bindings for dependencies of the same class or protocol. I'll submit a pull request, but I'd appreciate any feedback before accepting it. |
It would be interesting if a module could add an NSDictionary to an injector and have a new macro that maps keys in that dictionary to properties.
Something like:
While not needed it would be nice to have a convience method that would load a plist like that.
The text was updated successfully, but these errors were encountered: