2016-09-07 2 views
1

자동 주입 매크로가있는 조립품을 올바르게 가져 오는 데 문제가 있습니다. 어셈블리를 얻었 기 때문에,Typhoon 자동 삽입 (프로토콜에 의한 조립)

@interface MyStuff() 

@property (nonatomic, strong) InjectedProtocol(IFormatterProvider)formatterProvider; 

@end 

그러나 (BTW 오타가) 오류 "어떤 구성 요소 유형을 satisify 정의되지"점점 예를 들어 :

@protocol IFormatterProvider <NSObject> 

- (id)statusTextFormatter; 

@end 

@interface MyAssembly : TyphoonAssembly <IFormatterProvider> 
@end 

@implementation MyAssembly 

- (id <IFormatterProvider>)formatterProvider 
{ 
    return [TyphoonDefinition with:self]; // First guess 
} 

- (id)statusTextFormatter 
{ 
    // impl 
} 

@end 

그런 다음 비즈니스 로직 파일을 사용하려고 TyphoonInjectionDefinition로 등록 된 NSObject

내가하고있는 일을 할 수 있습니까?

답변

1

this approach을 사용하여 조립품 자체를 공장 또는 제공 업체의 역할로 삽입 할 수 있습니다. 이는 명시적인 배선입니다.

어셈블리 와이어 링을 위해 자동 배선이 작동하지 않는다고 생각하지만 관심이 있다면 기능 요청을 제출할 수 있습니다.

+0

명백한 주입을 피할 수 없다는 것을 알고 싶었습니다. [문제] (https://github.com/appsquickly/Typhoon/issues/529) 추가됨 – Emil