• 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: returning NO from readFromFile:ofType: causes exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: returning NO from readFromFile:ofType: causes exception
      • From: Robert Clair <email@hidden>
References: 
 >returning NO from readFromFile:ofType: causes exception (From: Robert Clair <email@hidden>)
 >Re: returning NO from readFromFile:ofType: causes exception (From: Robert Clair <email@hidden>)

  • Prev by Date: Re: Finding a view (Cocoa theory)
  • Next by Date: Re: returning NO from readFromFile:ofType: causes exception
  • Previous by thread: Re: returning NO from readFromFile:ofType: causes exception
  • Next by thread: Re: returning NO from readFromFile:ofType: causes exception
  • Index(es):
    • Date
    • Thread