iPhone - encoding and decoding a NSValue
So I read here on SO that I can encode a CGLayerRef to a NSValue using
NSValue *myCopy = [[NSValue all开发者_C百科oc] initWithBytes:&myLayer objCType:@encode(CGLayerRef)];
but how do I recreate the CGLayerRef from myCopy?
thanks
This should work:
CGLayerRef giveMeBackTheLayer;
[myCopy getValue:&giveMeBackTheLayer];
精彩评论