Re: Analyzer Messages
Re: Analyzer Messages
- Subject: Re: Analyzer Messages
- From: Jens Alfke <email@hidden>
- Date: Thu, 11 Aug 2011 13:16:04 -0700
On Aug 11, 2011, at 1:00 PM, Gordon Apple wrote:
> self.captureManager = [[AVCamCaptureManager alloc] init];
> [self.captureManager release];
The analyzer probably doesn’t like any call to -release on a property value. Whether this code is correct or not depends on how the property is implemented — there’s no guarantee that the getter has to return the exact same object instance you passed to the setter. If you changed the mode from retain to copy it would break, for instance. Or if you had a custom -setCaptureManager: method that ended up storing a different object than the one passed in.
It’s a lot safer to use
self.captureManager = [[[AVCamCaptureManager alloc] init] autorelease];
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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