我对 Xcode 很陌生(提前道歉)。尝试将一些旧代码带入生活。尝试迁移到 Swift 5 时获得以下信息。
withUnsafeMutableBytes' 已弃用:
withUnsafeMutableBytes<R>(_: (UnsafeMutableRawBufferPointer) throws -> R) rethrows -> R改用
目标:我需要做的就是适当修改代码并完成。
我查看了其他 Stack Overflow 消息,搜索了各种文章,尝试了不同的东西,但无法快速确定需要更改的内容。我确信对于了解更多的人来说,解决方案非常简单。
var responseData = Data(count: Int(responseDataLength))
_ = responseData.withUnsafeMutableBytes
{
mfError = MFMediaIDResponse_GetAsString(mfMediaIdResponsePtr.pointee, MFString($0), responseDataLength)
}
Run Code Online (Sandbox Code Playgroud) swift5 ×1