NSRtring

时间:2017-11-28 19:15:22

标签: swift nsstring

我有一个AVDepthDataObject,我正在尝试调用dictionaryRepresentation()函数。该函数以AutoreleasingUnsafeMutablePointer<NSString?>为参数,我遇到了问题。

我试过了:

//Make a string and a pointer
let depthString: NSString = NSString()
let depthStringPointer = AutoreleasingUnsafeMutablePointer<NSString?>.init(&depthString)

//Dump the depth data into the str
depthData.dictionaryRepresentation(forAuxiliaryDataType: depthStringPointer)

但我在depthStringPointer初始化时收到错误说:

  

&#39;&安培;&#39;用于&#39; RawPointer&#39;

类型的非inout参数

我不确定如何正确初始化NSString类型的AutoreleasingUnsafeMutablePointer

我试过了:

depthData.dictionaryRepresentation(forAuxiliaryDataType: &depthString)

this question,但我收到错误

  

无法传递类型&#39; NSString的不可变值?&#39;作为inout参数

0 个答案:

没有答案