@leo-dabus almost got it right. For the above example where values
is defined as:
let values = ["VAL1", "VAL2", "VAL3"]
converting the array to a CVarArg
argument should be defined as:
let cVarArgValues = values as [CVarArg]
which will give you cVarArgValues
in the desired format of 3 distinct values in a single array; ["VAL1", "VAL2", "VAL3"]
.
If you don't wrap CVarArg
in []
, you'll get a valid, albeit incorrect, argument list consisting of a single-value array wrapping values
as an inner array; [["VAL1", "VAL2", "VAL3"]]
.