NSObject+Etoile documentation

Authors

Quentin Mathe (qmathe@club-internet.fr)
NSObject basic reflection additions.

Copyright: (C) 2007 Quentin Mathe

Software documentation for the NSObject(Etoile) category

NSObject(Etoile)

Declared in:
NSObject+Etoile.h

@group Reflection

This category extends NSObject reflection API in a minimal way.

The true Etoile reflection API is declared in ETReflection.h.

Method summary

allSubclasses 

+ (NSArray*) allSubclasses;

Returns all descendant subclasses of the receiver class.

The returned array doesn't include the receiver class.

You should rather use -[ETClassMirror allSubclassMirrors], this method could be deprecated in the future.


directSubclasses 

+ (NSArray*) directSubclasses;

Returns all subclasses which inherit directly from the receiver class.

Subclasses that belongs to the class hierarchy of the receiver class but whose superclasses aren't equal to it, are excluded.

The returned array doesn't include the receiver class.


typePrefix 

+ (NSString*) typePrefix;
An empty method provided for subclasses to override.

Returns the type prefix, usually the prefix part of the type name returned by -className .

By default, returns 'NS'.

You must override this method in your subclass to indicate the prefix of your new class name. Take note the prefix will logically apply to every subsequent subclasses inheriting from the class that redefines -typePrefix .


UTI 

- (ETUTI*) UTI;

Returns the uniform type identifier of the object.

The UTI object encodes the type of the object in term of namespaces and multiple inheritance.

By default, the UTI object is shared by all instances by being built from the class name. If you need to introduce type at instance level, you can do it by overriding this method.


className 

- (NSString*) className;

Returns the class name.

This Foundation method is missing on iOS.


typeName 

- (NSString*) typeName;

Returns the type name which is the last component of the string value returned by the receiver UTI object.

See also -UTI .