Discussion 解説
This property returns a proxy for the receiving object if the receiver adopts the NSDiscardable
protocol and still has content that has not been discarded.
The proxy calls begin
on the receiver to keep the content available as long as the proxy lives, and calls end
when the proxy is deallocated.
The wrapper object is otherwise a subclass of NSProxy
and forwards messages to the original receiver object as an NSProxy
does.
This method can be used to hide an NSDiscardable
object's content volatility by creating an object that responds to the same messages but holds the contents of the original receiver available as long as the created proxy lives. Thus hidden, the NSDiscardable
object (by way of the proxy) can be given out to unsuspecting recipients of the object who would otherwise not know they might have to call begin
and end
around particular usages (specific to each NSDiscardable
object) of the NSDiscardable
object.