提问人:7ball 提问时间:5/7/2017 更新时间:11/29/2017 访问量:2514
部分应用转发器进行重新抽象 thunk helper from @callee_unowned
partial apply forwarder for reabstraction thunk helper from @callee_unowned
问:
我有以下 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
答:
0赞
Igor Bachek
11/29/2017
#1
可能在里面你打了几次电话。afnetworking.get(someURL, parameters: nil, successHandler:
successHandler
第二次调用导致应用崩溃optionalHandler()
评论