IPhone - encoding and decoding NSValue

So, I read here about SO that I can encode CGLayerRef in NSValue using

NSValue *myCopy = [[NSValue alloc] initWithBytes:&myLayer objCType:@encode(CGLayerRef)]; 

but how do I recreate a CGLayerRef from myCopy?

thanks

+6
source share
1 answer

This should work:

 CGLayerRef giveMeBackTheLayer; [myCopy getValue:&giveMeBackTheLayer]; 
+6
source

Source: https://habr.com/ru/post/889591/


All Articles