Re: Returning nil from -init
Re: Returning nil from -init
- Subject: Re: Returning nil from -init
- From: j o a r <email@hidden>
- Date: Wed, 12 Mar 2003 17:40:26 +0100
...or alternatively something that might actually work:
- (id) initWithData:(NSData *) data
{
self = [super init];
if (self != nil)
{
if ([self _parseData: data])
{
[self setData: data];
}
else
{
[self release];
self = nil;
}
}
return self;
}
j o a r
On Wednesday, Mar 12, 2003, at 17:04 Europe/Stockholm, Mondragon, Ian
wrote:
// then you can verify the pdb argument before
// setting it as an ivar & not have to deal with it
- initWithData:(NSData *)pdb
{
if ((self = [super init]))
{
if ([self _parseData:pdb])
{
[self setData:pdb];
return YES;
}
}
return NO;
}
_______________________________________________
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.