简体   繁体   English

注入预先获取的对象时发生崩溃

[英]Crash when injecting a pre-obtained object

I want to use an object that I got from another module. 我想使用从另一个模块获得的对象。 I cannot figure out how to use 我不知道如何使用

#Instructing Typhoon to Inject a Pre-obtained Instance #指示台风注入预先获取的实例

from the doc 文档

I am trying to do this so: 我正在尝试这样做:

self.someAssembly = [[SomeAssembly new] activated];
[self.someAssembly inject:someObject];
SomeModule *module = [self.someAssembly getModule];

If I try to inject it by type in some definition I get crash with message: 如果我尝试按某种定义键入它,则会崩溃并显示以下消息:

No components defined which satisify type: 'SomeObject' 没有定义满足类型的组件:“ SomeObject”

So how can I use this very someObject in my definitions from SomeAssembly ? 那么,如何在SomeAssembly定义中使用这个someObject

Thank you! 谢谢!

This happens because injecting an object that was built outside of Typhoon does not register it with the assembly. 发生这种情况是因为注入在Typhoon之外构建的对象不会将其注册到程序集中。

Is it possible you can register a definition? 是否可以注册定义?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM