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

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -