Up

NSValueTransformer class documentation

Authors

Generated by fedor

Software documentation for the NSValueTransformer class

NSValueTransformer : NSObject

Declared in:
Foundation/NSValueTransformer.h
Availability: MacOS-X 10.3.0, Base 1.2.0

Instances of the NSValueTransformer class are used to convert values from one representation to another. The base class is abstract and its methods must be overridden by subclasses to do the actual work.
Method summary

allowsReverseTransformation 

+ (BOOL) allowsReverseTransformation;
Availability: MacOS-X 10.3.0, Base 1.2.0

Subclasses must override this method.
Returns a flag indicating whether the transformer permits reverse transformations.

setValueTransformer: forName: 

+ (void) setValueTransformer: (NSValueTransformer*)transformer forName: (NSString*)name;
Availability: MacOS-X 10.3.0, Base 1.2.0

Registers transformer to handle transformations with the specified name.

transformedValueClass 

+ (Class) transformedValueClass;
Availability: MacOS-X 10.3.0, Base 1.2.0

Subclasses must override this method.
Returns the class of the value produced by this transformer.

valueTransformerForName: 

+ (NSValueTransformer*) valueTransformerForName: (NSString*)name;
Availability: MacOS-X 10.3.0, Base 1.2.0

Returns the transformer registered for the specified name, or nil if no transformer is registered for name. If no transformer is found, but the name corresponds to a valid NSValueTransformer subclass name, the receiver instantiates this subclass using -init and registers it automatically for name.

valueTransformerNames 

+ (NSArray*) valueTransformerNames;
Availability: MacOS-X 10.3.0, Base 1.2.0

Returns an array listing the names of all registered value transformers.

reverseTransformedValue: 

- (id) reverseTransformedValue: (id)value;
Availability: MacOS-X 10.3.0, Base 1.2.0

Performs a reverse transformation on the specified value and returns the resulting object.
The default implementation raises an exception if +allowsReverseTransformation returns NO, otherwise it calls -transformedValue: and returns the result.

transformedValue: 

- (id) transformedValue: (id)value;
Availability: MacOS-X 10.3.0, Base 1.2.0

Subclasses must override this method.
Subclasses should override this method to perform the actual transformation (and reverse transformation if applicable) and return the result.


Up