• 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: Release understanding help…
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Release understanding help…


  • Subject: Re: Release understanding help…
  • From: Sherm Pendley <email@hidden>
  • Date: Tue, 7 Dec 2004 00:20:11 -0500

On Dec 6, 2004, at 8:35 PM, Mark Dawson wrote:

(1) When I try to do a release on the "validChars", I get a crash (msg_objc). Shouldn't I be releasing it? I DID create it with an alloc…

You first create it with an alloc:

NSString* validChars = [[NSString alloc] initWithString: @"0123456789mc/'\" "];

But then you replace it with an autoreleased NSString, and the one you created above just leaks:


validChars = [validChars stringByAppendingString:[[NSUserDefaults standardUserDefaults] objectForKey:NSDecimalSeparator]];

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Release understanding help… (From: Mark Dawson <email@hidden>)

  • Prev by Date: Re: Which class methods return autoreleased objects?
  • Next by Date: Re: searching with bindings
  • Previous by thread: Re: Release understanding help…
  • Next by thread: NSView not resizing when parent view resizes
  • Index(es):
    • Date
    • Thread