NSObject is the root class of
Cocoa, however the
Objective-C language itself does not define any root classes at all its define by
Cocoa, Apple's Framework.This root class of most Objective-C class hierarchies, from which subclasses inherit a basic interface to the runtime system and the ability to behave as Objective-C objects.
This class have all basic property of
Objective'C class object like:
class (name of the class).
superclass (superclass of current class).
@interface NSString : NSObject (
NSObject is a base class of NSString class).
You can use below methods for allocation of string class:
- (instancetype)init + (instancetype)new + (instancetype)alloc
For Copy any object :
- (id)copy; - (id)mutableCopy;
For compare objects :
To get superclass of current class :
To check which kind of class is this ?
Some property of NON-ARC classes:
- (instancetype)retain OBJC_ARC_UNAVAILABLE; - (oneway void)release OBJC_ARC_UNAVAILABLE; - (instancetype)autorelease OBJC_ARC_UNAVAILABLE; - (NSUInteger)retainCount