• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Static Analyzer Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static Analyzer Question


  • Subject: Re: Static Analyzer Question
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 29 Sep 2009 17:31:40 -0700


On Sep 29, 2009, at 5:12 PM, Steve Cronin wrote:

"…. Object with +0 retain counts returned to caller where a +1 (owning) retain count is expected"
this is shown at the end of a particular method.

I think this means the method has a name that by convention indicates that it returns a reference the caller must release — i.e. a prefix of "alloc" or "copy" or "mutableCopy"


+ (NSString *) fooBar {
	NSString *result = @"";
…..
	if (x) {
		result = @"1";
...
	} else {
		result = @"2";
	}
	return result;
}

What's the actual name (not 'fooBar')?

Why does Clang believe that an 'owning retain count is expected' if the method is never called?

Objective-C is a dynamic enough language that there is no way to tell at compile time whether a method is reachable or not. Even if that selector never appears in your code, it could be constructed at runtime, or your code could load a plugin bundle that calls that selector.


—Jens_______________________________________________

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


  • Follow-Ups:
    • Re: Static Analyzer Question
      • From: Dave DeLong <email@hidden>
    • Re: Static Analyzer Question
      • From: Steve Cronin <email@hidden>
References: 
 >Static Analyzer Question (From: Steve Cronin <email@hidden>)

  • Prev by Date: Re: Static Analyzer Question
  • Next by Date: Re: Fast transition between two graphics
  • Previous by thread: Re: Static Analyzer Question
  • Next by thread: Re: Static Analyzer Question
  • Index(es):
    • Date
    • Thread