• 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: Memory management question in Objective-C 2.0 @property notation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory management question in Objective-C 2.0 @property notation


  • Subject: Re: Memory management question in Objective-C 2.0 @property notation
  • From: Chris Suter <email@hidden>
  • Date: Thu, 5 Feb 2009 16:20:10 +1100

Hi Kiel,

On Thu, Feb 5, 2009 at 4:10 PM, Kiel Gillard <email@hidden> wrote:

> However, doing this will yield a memory leak:
> self.name = [[NSString alloc] init];
>
> ...because the property definition tells the compiler the methods it
> synthesizes should retain the value.

You're right that it will leak in that case but you've given the wrong
reason as to why. Memory management rules are covered by Apple's
documentation.

Regards,

Chris
_______________________________________________

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: Memory management question in Objective-C 2.0 @property notation
      • From: Kiel Gillard <email@hidden>
References: 
 >Memory management question in Objective-C 2.0 @property notation (From: Devraj Mukherjee <email@hidden>)
 >Re: Memory management question in Objective-C 2.0 @property notation (From: Kiel Gillard <email@hidden>)

  • Prev by Date: Re: Memory management question in Objective-C 2.0 @property notation
  • Next by Date: Re: Memory management question in Objective-C 2.0 @property notation
  • Previous by thread: Re: Memory management question in Objective-C 2.0 @property notation
  • Next by thread: Re: Memory management question in Objective-C 2.0 @property notation
  • Index(es):
    • Date
    • Thread