3 ms·
NSObject (1994)
- tlrobinson 10y agoFor comparison: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/ https://developer.apple.com/library/mac/documentation/Cocoa/...
- mpweiher 10y agoNote how most (though not all) of the methods that return an object do not declare a return type, even though this version of Objective-C supported those declarations (see the description method). Also note that this is Enterprise Object Framework 1.0, which was the first piece of software to include Foundation and therefore NSObject. What's interesting is that it says NSObject is the root of all objects. On NeXTStep, this wasn't actually the case for quite some time, Object was the root, and continued to be a root for quite some time. In fact, I can still find the Object class in OS X 10.11. So, either the documentation is incorrect (er, slightly "optimistic"), or this is for a version of EOF that did not run on NeXTStep. Anyway, cool stuff :-)
- joshstrange 10y agoInteresting the link tlrobinson linked [0] (current NSObject docs) says: > NSObject is the root class of most Objective-C class hierarchies. vs > NSObject is the root class of all ordinary Objective C inheritance hierarchies [0] https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/ https://developer.apple.com/library/mac/documentation/Cocoa/...
- wsc981 10y agoNSProxy would be another root class. I don't know if there are any other ones: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSProxy_Class/index.html https://developer.apple.com/library/mac/documentation/Cocoa/...
- leonatan 10y agoObject is the root in non-Foundation hierarchies. For example, when compiling the runtime for Linux or Windows, this is the root class to use (or make your own). NSObject does not inherit from Object, but it does implement its functionality independently.
- leonatan 10y agoAlso, regarding declaration of return type. By default, Objective C methods return id type. At the time, only methods that returned a more specific types were declared explicitly.