I know you can implement using Object class but is there any in Apple's Objective C?
Just about every Cocoa class inherits from NSObject
. Even the slightly esoteric Block objects, whose class tree isn't public, have NSObject
at the root.
The only other root class that is publicly known in Cocoa is NSProxy
, though it does conform to the NSObject
protocol, which allows it to act in many ways like any other Cocoa object.
In theory, it is possible to define a class that does not inherit from NSObject.
But in practice it is so difficult that no-one ever bothers to do it. NSObject does quite a lot of very nice stuff for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With