I have the following Dictionary:
let example: [String: (Int, Int)] = ["test": (0, 1)]
I need to store this as an NSData variable, and to do that it must first be converted to an NSValue, which I try to do as follows:
let nsval = NSValue().getValue(example as! UnsafeMutableRawPointer)
Only to be met with the error:
Cannot convert value of type 'Void' (aka '()') to specified type 'NSValue'
I've seen SO answers that suggest using:
let test = UnsafeMutablePointer.load(example)
But that also yields the error:
Type 'UnsafeMutablePointer<_>' has no member 'load'
So then, how is one to convert a dictionary to an NSValue in Swift 3?
In theory, if you really want to turn a swift Tuple into a data object, you could do this.
heres the reverse:
Beware: this is the path to the dark side.