Re: returning NO from readFromFile:ofType: causes exception
Re: returning NO from readFromFile:ofType: causes exception
- Subject: Re: returning NO from readFromFile:ofType: causes exception
- From: Clark Cox <email@hidden>
- Date: Fri, 18 Feb 2005 20:34:28 -0500
On Fri, 18 Feb 2005 17:32:51 -0500, Robert Clair <email@hidden> wrote:
> Sorry to reply to my own post, but a bit more information:
>
> my document subclass overrides initWithContentsOfFile:ofType: -
>
> - (id)initWithContentsOfFile:(NSString *)fileName ofType:(NSString
> *)docType
> {
> [super initWithContentsOfFile: fileName ofType: docType];
>
> if (self )
> {
> // custom stuff
> }
> return self;
> }
Change that to:
- (id)initWithContentsOfFile:(NSString *)fileName ofType:(NSString*)docType
{
self = [super initWithContentsOfFile: fileName ofType: docType];
if (self )
{
// custom stuff
}
return self;
}
It is important that you don't ignore the result of [super init...].
--
Clark S. Cox III
email@hidden
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/
_______________________________________________
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