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

Re: error message


  • Subject: Re: error message
  • From: David Remahl <email@hidden>
  • Date: Sun, 20 Oct 2002 03:03:23 +0200

It probably _is_ too late.

The error message says that the function (method in this case) reaches the
end, even though it is not a void function. The reason it 'reaches end' is
that it doesn't use the return keyword. With those clues, it is easy to spot
the mistake:

- (id)init
{
if( self = [super init] )
{
// blah
}
return self; // !!!***!!!
}

/ Rgds, David

> It's probably just late, but I can't figure out why I'm getting:
>
> AppController.m.18: warning: control reaches end of non-void function
>
> with this code:
>
> @implementation AppController
>
> - (id)init
> {
> if (self = [super init])
> (NSArray *)resultArray = [[NSArray alloc] init];
> } // this line selected by warning system!
>
> Anyone feeling generous tonight?
>
> Brian
_______________________________________________
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.

References: 
 >error message (From: "Brian E. Howard" <email@hidden>)

  • Prev by Date: error message
  • Next by Date: [sharedWorkspace isFilePackageAtPath: path]
  • Previous by thread: error message
  • Next by thread: [sharedWorkspace isFilePackageAtPath: path]
  • Index(es):
    • Date
    • Thread