{"action":"closed","issue":{"url":"https://api.github.com/repos/appsquickly/Typhoon/issues/306","labels_url":"https://api.github.com/repos/appsquickly/Typhoon/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/appsquickly/Typhoon/issues/306/comments","events_url":"https://api.github.com/repos/appsquickly/Typhoon/issues/306/events","html_url":"https://github.com/appsquickly/Typhoon/issues/306","id":54436505,"number":306,"title":"Property nil-ed after constructor injection.","user":{"login":"mmiedlarz","id":1328381,"avatar_url":"https://avatars.githubusercontent.com/u/1328381?v=3","gravatar_id":"","url":"https://api.github.com/users/mmiedlarz","html_url":"https://github.com/mmiedlarz","followers_url":"https://api.github.com/users/mmiedlarz/followers","following_url":"https://api.github.com/users/mmiedlarz/following{/other_user}","gists_url":"https://api.github.com/users/mmiedlarz/gists{/gist_id}","starred_url":"https://api.github.com/users/mmiedlarz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmiedlarz/subscriptions","organizations_url":"https://api.github.com/users/mmiedlarz/orgs","repos_url":"https://api.github.com/users/mmiedlarz/repos","events_url":"https://api.github.com/users/mmiedlarz/events{/privacy}","received_events_url":"https://api.github.com/users/mmiedlarz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-01-15T11:00:27Z","updated_at":"2015-01-15T11:31:25Z","closed_at":"2015-01-15T11:31:25Z","body":"Hey,\r\n\r\nIts my first approach to DI in obj-c, so I'm using Typhoon to inject some components to my ViewController (using constuctor injection).\r\nIn constructor everything works great, but in viewDidLoad all injected parameters are set to nil.\r\nHere is my code:\r\n\r\nViewController:\r\n\r\n    @interface MyViewController ()\r\n    @property (nonatomic, strong, readonly) MyScanner *scanner;\r\n    @end\r\n\r\n    @implementation MyViewController\r\n\r\n    - (instancetype)initWithScanner:(MyScanner *)scanner\r\n    {\r\n        self = [super init];\r\n        if(self)\r\n        {\r\n            _scanner = scanner;\r\n        }\r\n        DDLogInfo(@\"Constructor %@\",_scanner);\r\n        return self;\r\n    }\r\n\r\n    - (void) viewDidLoad\r\n    {\r\n        [super viewDidLoad];\r\n        DDLogInfo(@\"viewDidLoad: %@\",_scanner);\r\n    }\r\n\r\nFactory:\r\n\r\n    - (MyViewController *)myViewController\r\n    {\r\n        return [TyphoonDefinition withClass:[MyViewController class]\r\n                configuration:^(TyphoonDefinition *definition)\r\n                {\r\n                    [definition useInitializer:@selector(initWithScanner:) parameters:^(TyphoonMethod *initializer)\r\n                     {\r\n                         [initializer injectParameterWith:[self.componentsAssembly scanner]];\r\n                     }];\r\n                }];\r\n    }\r\n\r\nComponentsAssembly:\r\n\r\n    - (MyScanner*) scanner;\r\n    {\r\n        return [TyphoonDefinition withClass:[MyScanner class]\r\n                configuration:^(TyphoonDefinition *definition)\r\n                {             \r\n                    [definition setScope:TyphoonScopePrototype];\r\n                }];\r\n    }\r\n\r\nOutput:\r\n\r\n    Constructor: <MyScanner: 0x17008f320>\r\n    viewDidLoad: (null)\r\n\r\nAm I doing something wrong, or did I forgot something?\r\n\r\nCheers,\r\nM.\r\n"}}