79142095

Date: 2024-10-30 17:03:16
Score: 0.5
Natty:
Report link

@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"]].

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @leo-dabus
  • Low reputation (0.5):
Posted by: olx