On more newbie question about init...
On more newbie question about init...
- Subject: On more newbie question about init...
- From: Scott Andrew <email@hidden>
- Date: Fri, 13 Jun 2003 20:16:04 -0700
I am writing my own -initWithFileContents for my objects. The base
class does nothing but store the file name they were loaded from. But
for my image class I have the following:
-(id)initWithFileContents:(NSString*) filePath
{
if (self = [super initWithFileContents:filePath])
{
image = [[NSImage alloc] initWithContentsOfFile:filePath];
if (image == nil)
{
[self release];
return nil;
}
}
return self;
}
Is it OK to call release on self like this to fail out of the imbedded
object doesn't create?
Scott Andrew
_______________________________________________
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.