Re: initWithContentsOfFile crash
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