Re: Virtual concept in Objective-C
Re: Virtual concept in Objective-C
- Subject: Re: Virtual concept in Objective-C
- From: Dix Lorenz <email@hidden>
- Date: Wed, 19 Jul 2006 08:43:58 +0200
On 19.07.2006, at 08:32, Vinay Prabhu wrote:
Hi,
I have few basic doubts in Objective-C.
Is there virtual concept in Objective - C as in C++?
Or is it default in Objective C?
Yes, every method is virtual.
While overriding the methods from super class,
Do we need to declare the function prototype in the derived class
header
file?
No.
When I have overridden the super class functions, I have tried both,
declaring the prototype and by not declaring the prototype in the
derived
class header file.
In both the cases it worked fine.
Just as it should ;-)
So is it necessary to declare the prototype? If not, if the
prototype is
declared in derived class is there any adverse effects?
No. Actually you don't even have to declare in the base class, it
would still work.
Dix
_______________________________________________
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