-
Notifications
You must be signed in to change notification settings - Fork 268
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
Add support for factories #11
Comments
This is already supported. I'll update the documentation ASAP. Meantime take a look at:
Which in the block style, is satisfied like so:
Ahhhhhhh. . . .. But you've just pointed out a TODO, that needs doing. You should be able to say fdefinition.factoryComponent = [self swordFactory] . . . .(currently it is the selector name in string form). Will fix this today. On Mar 3, 2013, at 1:47 AM, José González [email protected] wrote:
|
As of 1.1.2, you can now wire the factory with: definition.factory = [self swordFactory]; |
Updated the docs, but they need some more attention. |
Great!!! Thanks a lot! |
I was trying to create a Core Data stack using Typhoon and faced the following problem: I had to create the managed object model injecting the URL of the model in the initializer. The URL of the model is typically constructed this way:
As far as I know (correct me if I'm wrong) there is no way to create / inject such an object using Typhoon. I could build the main bundle object using Typhoon, but then I have no way of invoking a method on that object to get another object that gets injected in an additional object.
I think the general problem to be solved is to add support for factories: in fact the main bundle is a URL factory, using the method shown above. So maybe we could add something like this to Typhoon:
I've noticed I can have a workaround for this problem using type converters, creating a converter that converts the string "CoreDataTest.momd" to the required NSURL, but this would prevent the creation of a "natural" type converter from strings to NSURLs, as Typhoon only supports a converter for a given type.
What do you think? Am I missing anything?
The text was updated successfully, but these errors were encountered: