• 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: NSMutableString question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableString question


  • Subject: Re: NSMutableString question
  • From: Roland King <email@hidden>
  • Date: Wed, 17 Sep 2008 10:41:50 +0800

Jason Coco wrote:


NSMutableString *str = [[NSMutableString alloc] initWithCapacity:someAssumedCapacity];
/* do stuff */
[str release];


Is that actually guaranteed to release the string *right now*? I only ask because I seem to recall a message a couple of months ago about a more complicated object where it appeared that the initializer did a retain/autorelease on the object so it ended up in the autorelease pool before you even got hold of it. That was not an object obtained from a convenience method either IIRC, it was a [ [ SomeClass alloc ] initConstructorOfSomeSort ] call.

Unlikely the case with NSMutableString I'd think, but perhaps for other things.

The local autorelease pool version I'd think is guaranteed to work.

_______________________________________________

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: NSMutableString question
      • From: Jason Coco <email@hidden>
    • Re: NSMutableString question
      • From: Graham Cox <email@hidden>
    • Re: NSMutableString question
      • From: Bill Bumgarner <email@hidden>
References: 
 >NSMutableString question (From: John Zorko <email@hidden>)
 >Re: NSMutableString question (From: Dave DeLong <email@hidden>)
 >Re: NSMutableString question (From: Jason Coco <email@hidden>)

  • Prev by Date: Re: NSMutableString question
  • Next by Date: Re: NSMutableString question
  • Previous by thread: Re: NSMutableString question
  • Next by thread: Re: NSMutableString question
  • Index(es):
    • Date
    • Thread