> - (CGPDFDocumentRef)getPDFDocumentRef:(const char *)filename { 
>       CGPDFDocumentRef        document; 
> 
>        snip...
> 
>       document = CGPDFDocumentCreateWithURL(url); 
>       return document; 
> } 

The CF convention is that functions and methods that return a literal reference 
to an object - that is, the caller doesn't receive ownership of it - use the 
verb "get", as you have above.  Functions and methods which do return ownership 
use the "copy" or "create" verbs.

Clang Static Analyzer uses these cues to decide what it thinks you should be 
doing.  If you rename your above method to createPDFDocumentRef:, you should 
find it's a lot less confused.

Wade
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to