• 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: 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

  • Follow-Ups:
    • Re: Analyzer Messages
      • From: Kevin Elliott <email@hidden>
    • Re: Analyzer Messages
      • From: Seth Willits <email@hidden>
References: 
 >Analyzer Messages (From: Gordon Apple <email@hidden>)

  • Prev by Date: Re: 32-Bit Universal versus Standard 32/64-bit Universal
  • Next by Date: Re: Analyzer Messages
  • Previous by thread: Analyzer Messages
  • Next by thread: Re: Analyzer Messages
  • Index(es):
    • Date
    • Thread