【问题标题】:Combine SIL Instructions via Peephole Optimization in Swift 4通过 Swift 4 中的窥孔优化组合 SIL 指令
【发布时间】:2017-09-20 17:01:14
【问题描述】:

当我为 App Store 存档项目时,出现错误 Segmentation fault 11 1. 在运行过程中通过 #317780 SILFunctionTransform ""Combine SIL

Instructions via Peephole Optimization"" on SILFunction "@_T08myapp20ItchMessageViewModelC05photoC0AA0bcE8Protocol_pfgAA04ChatbcE0C_Tg5".
for getter for photoMessage at /Users/work/Desktop/myappProject/myappiOS/myapp/Groups/ChatGroup/ChatFactory/Bubbles/VideoBubble/Model/ItchMessageViewModel.swift:38:16

这段代码看起来像这样

open class ItchMessageViewModel<ItchMessageModelT: ItchMessageModelProtocol>: ItchMessageViewModelProtocol {

    public var itchID: String
    public var itchName: String

    public var photoMessage: ItchMessageModelProtocol { **This is 38 line**
        return self._itchMessage
    }

    public let _itchMessage: ItchMessageModelT
    public var transferStatus: Observable<TransferStatus> = Observable(.idle)
    public var transferProgress: Observable<Double> = Observable(0)
    public var transferDirection: Observable<TransferDirection> = Observable(.download)
    public var image: Observable<UIImage?>
    open var imageSize: CGSize {
        return self.photoMessage.imageSize
    }
    public let messageViewModel: MessageViewModelProtocol
    open var showsFailedIcon: Bool {
        return self.messageViewModel.showsFailedIcon || self.transferStatus.value == .failed
    }

    public init(itchMessage: ItchMessageModelT, messageViewModel: MessageViewModelProtocol) {
        self._itchMessage = itchMessage
        self.image = Observable(itchMessage.image)
        self.messageViewModel = messageViewModel
        self.itchName = itchMessage.itchName
        self.itchID = itchMessage.itchID
    }

    open func willBeShown() {
        // Need to declare empty. Otherwise subclass code won't execute (as of Xcode 7.2)
    }

    open func wasHidden() {
        // Need to declare empty. Otherwise subclass code won't execute (as of Xcode 7.2)
    }
}

但是设备或错误模拟器没有构建时间。我该如何解决?

【问题讨论】:

    标签: swift xcode swift4 xcode9


    【解决方案1】:

    我认为这不是最佳解决方案,但它对我有所帮助。

    在项目设置中,我选择了目标MyApp -> Build Settings -> Optimization Level -> Release None [-Onone]。

    我正在考虑为 Apple 创建一个错误报告,因为这段代码来自 Chatto framework,我也没有打算这样做。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-20
      • 1970-01-01
      • 2016-05-16
      • 2023-04-10
      • 2012-08-10
      • 1970-01-01
      • 2019-01-28
      相关资源
      最近更新 更多