Re: Removing a compiler warning
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.