Swift 2.2에서는 유효한 매개 변수로 이 필요한 유효한 매개 변수로 nil
을 전달할 수있었습니다. 스위프트 3, 나는 더 이상 할 수 없다 :UnsafePointer로 nil 전달 <UInt8>
func myFuncThatTakesAPointer(buffer: UnsafePointer<UInt8>, length: Int) { /** **/ }
myFuncThatTakesAPointer(buffer: nil, length: 0)
Playground execution failed: error: Xcode8Playground-iOS.playground:62:33: error: nil is not compatible with expected argument type 'UnsafePointer<UInt8>' myFuncThatTakesAPointer(buffer: nil, length: 0) ^
내가 지금 선택으로 내 함수의 포인터 선언을 지정할 필요가 있습니까?
확인하세요 [이 (https://github.com/apple/swift-evolution/blob/master/proposals/0055-optional-unsafe-pointers.md). – OOPer