objective c - Swift/ObjectiveC interoperability: closure property 'not found on object of type *' -


in swift class, have defined 2 closure properies so:

var confirmationhandler: ((address: address, refinedcoordinate: cllocationcoordinate2d?) -> void)?  var anotherhandler: ((address: address, refinedcoordinate: cllocationcoordinate2d) -> void)? 

when try set former objective c code, following error:

property 'confirmationhandler' not found on object of type...

i have no trouble setting latter. why this?

got answer off of post here: https://stackoverflow.com/a/26366344/1284996

the relevant passage:

optionals swift specific feature, not available in obj-c. optional class instances work because nil optional can mapped nil value, value types (int, floats, etc.) not reference types, hence variable of types don't store reference, value itself.


Comments

Popular posts from this blog

1111. appearing after print sequence - php -

node.js - Express and Redis - If session exists for this user, don't allow access -

excel - I can't get the attachement of the email PHP -