• 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: Proper idom for a failed init?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper idom for a failed init?


  • Subject: Re: Proper idom for a failed init?
  • From: Ondra Cada <email@hidden>
  • Date: Sun, 8 Sep 2002 03:29:21 +0200

On Sunday, September 8, 2002, at 02:54 , Dave Fayram wrote:

What happens if the init of your object fails?

init returns nil.

Since the memory is already alloc'd, do I need to dealloc it?

Yup (more presicely, to release, which means it would be dealloc'd automatically)

- initWithSomeCriticalJunk:(NSString *)junk {
if ((self=[super init])) {
if(![junk isValid]) {
[self release];
return nil;
}
...
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Proper idom for a failed init? (From: Dave Fayram <email@hidden>)

  • Prev by Date: Re: Proper idom for a failed init?
  • Next by Date: Automatic resizing
  • Previous by thread: Proper idom for a failed init?
  • Next by thread: Re: Proper idom for a failed init?
  • Index(es):
    • Date
    • Thread