Re: Analyzer Messages
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