• 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: Analyzer Messages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Analyzer Messages


  • Subject: Re: Analyzer Messages
  • From: Kevin Elliott <email@hidden>
  • Date: Thu, 11 Aug 2011 14:27:26 -0700

> On Aug 11, 2011, at 1:00 PM, Gordon Apple wrote:
>
>>       self.captureManager = [[AVCamCaptureManager alloc] init];
>>       [self.captureManager release];

Lots of people have talked about what's wrong with this, but no one has mentioned the right pattern:

self.captureManager= [[[AVCamCaptureManager alloc] init] autorelease];

It's one line, all of the memory management is self contained, and the analyzer won't bug you about it.

I keep threatening to write a Q&A about this sort of issue, but I've never figured out how to pull it together.  Mixing retain/release and properties is almost always a sign of problems in the underlying code base.  Pick one style and stick to it.  Any other way makes it to easy to tie yourself in nots and leads to confusion.

-Kevin
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Analyzer Messages (From: Gordon Apple <email@hidden>)
 >Re: Analyzer Messages (From: Jens Alfke <email@hidden>)

  • Prev by Date: Found: Replacement for "Front End" of User Scripts
  • Next by Date: Re: [ANN] Article on automated on-device testing on iOS (and Android)
  • Previous by thread: Re: Analyzer Messages
  • Next by thread: Re: Analyzer Messages
  • Index(es):
    • Date
    • Thread