我有一个如下所示的函数:
func receivedData(pChData: UInt8,andLength len: CInt) { var receivedData: Byte = Byte() var receivedDataLength: CInt = 0 memcpy(&receivedData,&pChData,Int(len)); // Getting the error here receivedDataLength = len AudioHandler.sharedInstance.receiverAudio(&receivedData,WithLen: receivedDataLength) }
得到错误:
Cannot pass immutable value as inout argument: ‘pChData’ is a ‘let’ constant
虽然我在这里传递的参数都不是常量.我为什么要这个?