• 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
best way to "reset" values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

best way to "reset" values


  • Subject: best way to "reset" values
  • From: Daniel Child <email@hidden>
  • Date: Sat, 01 Sep 2007 12:00:24 -0400

Hi All,

As I grapple with the whole memory management issue, a question I haven't seen explicitly addressed is now to reset ivars to default (empty) values.

As far as I understand, if I use

[self setMyString: @""];

then the @"" is a constant that can never be freed. Or is that OK? (I need to reset the value often, and don't want to leak memory.) Also, is the approach different if the ivar is a collection (set, array, dictionary...)?

Thanks.

Daniel
_______________________________________________

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: best way to "reset" values
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: NSBezierPath append CGGlyph
  • Next by Date: Re: NSBezierPath append CGGlyph
  • Previous by thread: Re: file scan results in EX_BAD_ACCESS
  • Next by thread: Re: best way to "reset" values
  • Index(es):
    • Date
    • Thread