gpt4 book ai didi

ios - 来自@callee_unowned 的部分应用转发器用于重新抽象 thunk helper

转载 作者:搜寻专家 更新时间:2023-10-30 22:18:22 28 4
gpt4 key购买 nike

我有以下 Swift 函数:

func refresh(optionalHandler: @escaping (() -> Void) = {}) {
afnetworking.get(someURL, parameters: nil, successHandler: {
(task: URLSessionDataTask, object: Any) in
print(task)
optionalHandler() // This crashes with EXC_BAD_ACCESS
})
}

不确定这里发生了什么......完整的错误是:

optionalHandler () -> ()    0x000000010018baac MyApp`partial apply forwarder for reabstraction thunk helper from @callee_unowned @convention(block) () -> () to @callee_owned () -> () at MyViewController.swift

最佳答案

可能在 afnetworking.get(someURL, parameters: nil, successHandler: 中你调用了几次 successHandler

第二次调用 optionalHandler() 使您的应用崩溃

关于ios - 来自@callee_unowned 的部分应用转发器用于重新抽象 thunk helper,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43825462/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com