How do I uniquely identify cgcontext?
Is there a开发者_StackOverflow社区ny way by which it is possible to uniquely identify CGContextRef?
Thanks
A CGContextRef
is just a pointer to a CGContext
struct. Because it's a pointer you can just use equality to check if they're the same context:
if( context1 == context2 )
{
//the contexts are the same
}
If you need to keep track of particular contexts, just store a reference to them, in an ivar or other variable. You can then use equality to check if a context matches:
if( someContext == yourContextIvar )
{
//the contexts are the same
}
精彩评论