Search Your Question

What is Unmanaged objects?

Ans : 


In rare cases, Core Foundation function may return a C-pointer or an object reference embedded into an Unmanaged wrapper. You must transfer Unmanaged references into the normal memory management system before working with them in Swift.

An Unmanaged wrapper, like an Optional wrapper, provides a layer of safety between your code and a potentially nasty crash.  The Unmanaged<T> type stores a pointer whose memory is not controlled by the Swift runtime system. Before using this data, you take responsibility for how this memory should stay alive.


No comments:

Post a Comment

Thanks