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

New initializer injection TyphoonParameterInjectedByFactoryReference #153

Closed
jasperblues opened this issue Jan 27, 2014 · 8 comments
Closed

Comments

@jasperblues
Copy link
Member

. . to match the recent addition to property-style injectors.

@jasperblues
Copy link
Member Author

Any comments @alexgarbarev ?

@alexgarbarev
Copy link
Contributor

No, it's clear.

And I think we have to do same API with boxing primitives for initializer. But now I see that it cannot be done by KVC, and I have to implement same way as KVC (with unboxing) but for initializer invocation.

FactoryReference way also should be introduced in xml, I believe.

Also I want to add void* pointer injection. It will be useful to inject dispatch_queue_t for example. We have to parse ^void type at runtime and add to typeDescription

@jasperblues
Copy link
Member Author

👍 It would be great to give initializer the same treatment.

Take a look at TyphoonTypeDescriptor, I believe it can decode void* arguments . . . (though it hasn't been used directly for this purpose yet).

For void*, both these conditions must be true

  • descriptor.primitiveType == TyphoonPrimitiveTypeVoid
  • descriptor.isPointer == YES

A point that is not directly related, but interesting:

As you've probably observed, the objective-C runtime gives very good introspection for properties. . . But for selector arguments its not quite as good, its either the primitive type or simply 'id'. . . this is why Typhoon's auto-wiring macros and by-type injection is only available for properties. . . for initializer it has to be manually specified. . . Primitive introspection is there though. . .

https://github.com/typhoon-framework/Typhoon/blob/master/Source/TypeConversion/TyphoonTypeDescriptor.m

@jasperblues
Copy link
Member Author

Relates to: #141

@jasperblues
Copy link
Member Author

If anyone wants to take this issue, just assign it to yourself. Otherwise I'll take it in the next few days.

@ghost ghost assigned alexgarbarev Jan 27, 2014
@alexgarbarev
Copy link
Contributor

This issue waits until #162 resolved (because depends on)

@jasperblues
Copy link
Member Author

Issue #162 is implemented and can be closed after review.

@alexgarbarev
Copy link
Contributor

This issue can be closed after review

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

2 participants