objective c - Is a CGContext an object? -


I've been programming for 2 months (so I am quite new) and I am currently learning how to attract Graphics for an iPhone app but I need clarification on CGContext . To create the current reference we use CGContextRef currentContext = UIGraphicsGetCurrentContext () , if here I understand well (and please correct me if I am wrong), UIGraphicsGetCurrentContext () On the current context, we provide it on an indicator type CGContexRef . Is there an object allocated to memory on the heap in the current context, or is it only a type of variable on the stack? I know that we use the pointer to work with the same data and avoid copying the big memory block (right?), But actually a CGContext , an object, a Straight or whatever?

These opaque types mean that you do not have to know and there is no need to take care . Apple can change its interior with every release and we do not know (and it is not needed). Typically, the FooRef type is the indication of something, now it has been defined:

  typedef struct CGContext * CGContextRef;   

But what if struct CGContext looks like this, we do not know. Generally maintain / release functions are:

  CGContextRef CGContextRetain (CGContextRef c); It  looks  as if it is actually the core forwardness (and perhaps Objective-C) object; Zero CGContextRelease (CGContextRef C);   

Common Core Foundation memory naming patterns apply: You do not need to issue CGContextRef or copy .

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -