6

So I read here on SO that I can encode a CGLayerRef to a NSValue using

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

but how do I recreate the CGLayerRef from myCopy?

thanks

4

1 に答える 1

6

これはうまくいくはずです:

CGLayerRef giveMeBackTheLayer;
[myCopy getValue:&giveMeBackTheLayer];
于 2011-06-02T01:11:29.970 に答える