• 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: initWithContentsOfFile crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: initWithContentsOfFile crash


  • Subject: Re: initWithContentsOfFile crash
  • From: Pontus Ilbring <email@hidden>
  • Date: Tue, 14 Jun 2005 22:49:18 +0200

On 6/14/05, Sanri Parov <email@hidden> wrote:
> - (id)initWithContentsOfFile:(NSString *)fileName ofType:(NSString
> *)docType
> {
>     NSLog(@"%@",fileName);
>     NSLog(@"%@",docType);
> }
>
> It does nothing!!! After the second NSLog, the app crashes with
> "Executable "myApp" has exited due to signal 11 (SIGSEGV)."

That method has a return type that isn't void, but it looks like you
don't return anything. Since it's an init method you're supposed to
return either an initialized object or nil. When you don't return
anything the computer will just grab whatever happens to be in the
return register and try to use that, which never works out.
 _______________________________________________
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

References: 
 >initWithContentsOfFile crash (From: Sanri Parov <email@hidden>)

  • Prev by Date: initWithContentsOfFile crash
  • Next by Date: Re: Core Data complex structure
  • Previous by thread: initWithContentsOfFile crash
  • Next by thread: Creating a subclass of an *unknown* object
  • Index(es):
    • Date
    • Thread