core foundation - Swift 2 CFType conversion -
in swift 1.2 had c function following signature:
__nonnull cfarrayref fdcreatesupportedaudiofileextensions() cf_returns_retained;
i know function returns array of cfstringref
instances, called swift this:
let supportedaudiotypes = fdcreatesupportedaudiofileextensions() as! [string]
and worked expected. however, in swift 2 code fails @ runtime due forced cast (exc_bad_instruction
). i'm able things working following:
let supportedaudiotypes = fdcreatesupportedaudiofileextensions() nsarray as! [string]
i'm unsure changed swift 1.2 2.0. bug in current version of swift or have missed something? i've read implies cftypes toll-free bridged swift counterparts i'm not sure why used work failing.
Comments
Post a Comment