Re: Proper idom for a failed init?
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.