线程17:EXC_BAD_INSTRUCTION代码= EXC_1386_INVOP,子代码= 0x0)

时间:2019-04-24 12:23:34

标签: ios swift swinject

为什么当我尝试运行我的应用程序时仍然会发生这种情况?这是在Swinject舱内:

这是发生问题的地方

public func _register<Service, Arguments>(
    _ serviceType: Service.Type,
    factory: @escaping (Arguments) -> Any,
    name: String? = nil,
    option: ServiceKeyOption? = nil
) -> ServiceEntry<Service> {
    let key = ServiceKey(serviceType: Service.self, argumentsType: Arguments.self, name: name, option: option)
    let entry = ServiceEntry(
        serviceType: serviceType,
        argumentsType: Arguments.self,
        factory: factory,
        objectScope: defaultObjectScope
    )
    entry.container = self
    services[key] = entry

    behaviors.forEach { $0.container(self, didRegisterType: serviceType, toService: entry, withName: name) }

    return entry
}

enter image description here

这是我的调试层次结构:

enter image description here

0 个答案:

没有答案