Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

inheritance in objective C

i am new to objective C.is it possible multiple ,multilevel,hybrid,hierarchical,all types of inheritance in objective C?

(Translation: What kind of inheritance does Objective-C support?)


2 Answers

No. Objective-C supports single inheritance.

You can declare multiple inheritance intentions through protocols, but you'll need to provide implementations per conforming class.

Categories allow for the extension of an existing class, but do not allow for the extension of multiple classes simultaneously.

I would suggest that you start here:

Introduction to The Objective-C 2.0 Programming Language

like image 172
bbum Avatar answered Feb 25 '26 01:02

bbum


No multiple inheritance of implementation in Objective C. As an alternative, consider categories. Not sure what you mean by multilevel, hybrid or hierarchical in this context. What are your actual NEEDS, as opposed to, a bunch of buzzwords...?-)

like image 26
Alex Martelli Avatar answered Feb 25 '26 01:02

Alex Martelli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!