Re: Analyzer Questions
Re: Analyzer Questions
- Subject: Re: Analyzer Questions
- From: Wade Tregaskis <email@hidden>
- Date: Tue, 02 Feb 2010 12:26:01 -0800
> - (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 (email@hidden)
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:
This email sent to email@hidden