Say, I have a C function:
const unsigned char *get_text(int idx);
In my Swift code, I invoke this C function:
let idx: CInt = 6
let txt = get_text(idx)
and I put the txt
to a NSMutableDictionary
:
var myDict = NSMutableDictionary()
//ERROR: Cannot invoke ‘setValue’ with an argument list of type ’UnsafePointer<UInt8>, forKey: String?)’
myDict.setValue(txt, forKey: “MyText”)
But I get the compiler error above. How can I set the value to my dictionary then?