• 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: Am I overreleasing something?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Am I overreleasing something?


  • Subject: Re: Am I overreleasing something?
  • From: Ondra Cada <email@hidden>
  • Date: Fri, 10 Jun 2005 18:53:49 +0200


On 10.6.2005, at 16:44, Glen Simmons wrote:
I suppose the other way is to avoid using autorelease, entirely, and use release whereever possible. At least that way I'll get my errors as soon as possible.

Well, there's no way to avoid using autorelease entirely.

There is, of course. You can use Cocoa-Java. Shudder :)

... autorelease is a very useful tool and you would be really limiting yourself if you tried to do without it.

Definitely.

NSString *foo = [[NSString alloc] initWithFormat:@"%d", myInt];
<more code>
// Sometime later, you have to remember to release foo or you'll have a memory leak.

Not speaking of that he should also use NS_DURING (or @try) to ensure that the object does not leak in case of an exception. And, things like returning an autoreleased object just *can't* be done reasonably without autorelease (means, each other alternative is much much worse).


So, instead of trying to avoid it, learn how to use it. You'll be a better programmer for it.

Amen to that. --- Ondra Čada OCSoftware: email@hidden http://www.ocs.cz private email@hidden http://www.ocs.cz/oc


_______________________________________________ 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
  • Follow-Ups:
    • Re: Am I overreleasing something?
      • From: "Theodore H. Smith" <email@hidden>
References: 
 >Am I overreleasing something? (From: "Theodore H. Smith" <email@hidden>)
 >Re: Am I overreleasing something? (From: Glen Simmons <email@hidden>)
 >Re: Am I overreleasing something? (From: "Theodore H. Smith" <email@hidden>)
 >Re: Am I overreleasing something? (From: Glen Simmons <email@hidden>)

  • Prev by Date: Help parsing dictionary integer
  • Next by Date: Re: Help parsing dictionary integer
  • Previous by thread: Re: Am I overreleasing something?
  • Next by thread: Re: Am I overreleasing something?
  • Index(es):
    • Date
    • Thread