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 -

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

Ruby on Rails, ActiveRecord, Postgres, UTF-8 and ASCII-8BIT encodings -