ios - cannot invoke initializer for Unmanaged<AnyObject>? with no arguments in swift -




what want convert rsa sec key base64 encoded string swift. initialized variable below,

var publickeybits = unmanaged<anyobject>?() 

then gives

cannot invoke initializer unmanaged? no arguments in swift

i want covert publickey below

var publickeybits = unmanaged<anyobject>?() secitemcopymatching(queryattrs, &publickeybits)  let opaquebits = publickeybits?.toopaque()  let publickeydata = unmanaged<nsdata>.fromopaque(opaquebits).takeunretainedvalue()  let publickeybase64 = publickeydata.base64encodeddata(nsdatabase64encodingoptions.encoding64characterlinelength) 

error. idea of this.

you need check initialization of unmanaged class, there might initialization parameters.

var publickeybits = unmanaged<anyobject>("mykey") 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -