小编Muh*_*een的帖子

存档时Xcode 10 Generics typealias Segmentation Fault 11

Xcode 10存档时出现分段错误

注意:

  • Xcode 10 在设备和模拟器上构建运行正常,在Xcode 9.4中,归档,构建运行也很好

我的代码:

typealias ResponseBlock<T> = (_ sender: T) -> Void
Run Code Online (Sandbox Code Playgroud)

我在整个项目中使用它,如:

var callback: ResponseBlock<AnyObject>? 
Run Code Online (Sandbox Code Playgroud)

在Xcode 10上存档时出错:

  1. 同时生成Objective-C头
  2. 打印时................
  3. 打印类型'ResponseBlock <[IndexPath]>'(声明在.....] RangeText ="typealias ResponseBlock =(_ sender:T) - > V")
  4. 打印类型'(T)' 错误:分段错误:11

用法:

var refreshCells: ResponseBlock<[IndexPath]>?
viewModel.refreshCells = {indexPathList in 
     self.collectionView.reloadItems(at:   indexPathList)
}
Run Code Online (Sandbox Code Playgroud)

generics ios type-alias swift xcode10

5
推荐指数
1
解决办法
393
查看次数

标签 统计

generics ×1

ios ×1

swift ×1

type-alias ×1

xcode10 ×1