magnumrocha
04/13/2020, 11:39 AMCOpaquePointer
?
in Swift we can do something like:
var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil)
<http://context.info|context.info> = Unmanaged<Reachability>.passUnretained(self).toOpaque()
where self
is a the Swift class that contain this code...Artyom Degtyarev [JB]
04/13/2020, 1:24 PMmagnumrocha
04/13/2020, 1:47 PMStableRef.create(myKClassInstance)
is the same of a Unmanaged<MyKClass>.passUnretained(this)
? I mean, this has the same effect...Artyom Degtyarev [JB]
04/13/2020, 2:27 PMmagnumrocha
04/13/2020, 2:46 PMsvyatoslav.scherbina
04/13/2020, 2:48 PMStableRef
should eventually be disposed manually (using .dispose
)magnumrocha
04/13/2020, 2:48 PM