Swift 4 code:
self.dataArray = data.withUnsafeBytes {
[UInt16](UnsafeBufferPointer(start: $0, count: data.count))
}
From looking at other answers to similar problems, I changed the above to:
self.dataArray = data.withUnsafeBytes {$0.load(as: [UInt16].self)}
The code compiles but gives me an exception: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
Any ideas? Thanks