Warning: Initialization of ‘UnsafeBufferPointer’ results in a dangling buffer pointer
I also met these annoying warnings. var str = “aaaaabbbbbccccc” var num1 = 1 var num2 = 22 var data = Data() // Initialization of ‘UnsafeBufferPointer<String>’ results in a dangling buffer pointer data.append(UnsafeBufferPointer(start: &str, count: 1)) // Initialization of ‘UnsafeBufferPointer<Int>’ results in a dangling buffer pointer data.append(UnsafeBufferPointer(start: &num1, count: 1)) // Initialization of ‘UnsafeBufferPointer<Int>’ results … Read more