• 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: Removing a compiler warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing a compiler warning


  • Subject: Re: Removing a compiler warning
  • From: Jörn Salewski <email@hidden>
  • Date: Sun, 01 Feb 2004 02:15:10 +0100

am 01.02.2004 1:56 Uhr schrieb Greg Hulands unter
email@hidden:

> The warning is this
>
> warning: `return' with a value, in function returning void
>
>

And this warning is also the answere to your question.
Apparently you explicitly try to return a value in a function that shouldn't
return anything (thats the meaning of 'returning void'.)

A proper dealloc method looks like this:

- (void) dealloc {

[yourSubclassInstanceVariable release];
[super dealloc];
}

That's it.

You've probably written "return [super dealloc]". Coding your method as
above makes your code compile without any problems (well at least not in
this method).

BTW a quick lookup in the documentation that I have mentioned in my earlier
post could have saved you this question. There you'll find a short example
code like the one I gave.

Yours,

Joern Salewski

PS: The warning says "FUNCTION returning..." Shouldn't it be rather "METHOD
returning..." ?
_______________________________________________
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.

  • Prev by Date: Re: Removing a compiler warning
  • Next by Date: Re: Recommendations for storing text messages in data files
  • Previous by thread: Re: Removing a compiler warning
  • Next by thread: Re: Recommendations for storing text messages in data files
  • Index(es):
    • Date
    • Thread