0
負荷iPhone5的(10.2)模擬器此功能:致命錯誤:從錯位原始指針
static func fromByteArray<T>(_ value: [UInt8], _: T.Type) -> T {
return value.withUnsafeBytes {
$0.baseAddress!.load(as: T.self)
}
}
崩潰在$0.baseAddress!.load(as: T.self)
與此錯誤:
fatal error: load from misaligned raw pointer
是否有人知道解決?
我使用這個代碼:
https://stackoverflow.com/a/26954091/1979882
編輯 它適用於iPhone5s但不是iPhone5的