Inherits from NSObject
Conforms to NSCoding
NSCopying
Declared in KKMutableNumber.h

Overview

Similar to NSNumber, but allows numbers to be modified (hence: mutable). It does not inherit NSNumber, the implementation is lightweight and encapsulates various classes like KKBoolNumber, KKInt32Number, KKDoubleNumber and so on each containing only a single property of the given data type.

This is what makes NSMutableNumber numbers mutable, they’re regular properties of objects encapsulating integral data types.

Once a concrete subclass of KKMutableNumber has been created using one of the initializers, the type of that number is set and can not be changed. For example, if you assign a BOOL value to a float number, the BOOL value will be cast to float. Likewise if you access the charValue property of a number whose type is float, the returned value will be cast from float to char before it is returned.

Properties

boolValue

Get or set the number’s value as/from type BOOL.

@property (atomic) BOOL boolValue

Declared In

KKMutableNumber.h

charValue

get or set the number’s value as/from type char

@property (atomic) char charValue

Declared In

KKMutableNumber.h

doubleValue

get or set the number’s value as/from type double

@property (atomic) double doubleValue

Declared In

KKMutableNumber.h

floatValue

get or set the number’s value as/from type float

@property (atomic) float floatValue

Declared In

KKMutableNumber.h

intValue

get or set the number’s value as/from type int

@property (atomic) int intValue

Declared In

KKMutableNumber.h

integerValue

get or set the number’s value as/from type NSInteger

@property (atomic) NSInteger integerValue

Declared In

KKMutableNumber.h

longLongValue

get or set the number’s value as/from type long long

@property (atomic) long long longLongValue

Declared In

KKMutableNumber.h

longValue

get or set the number’s value as/from type long

@property (atomic) long longValue

Declared In

KKMutableNumber.h

shortValue

get or set the number’s value as/from type short

@property (atomic) short shortValue

Declared In

KKMutableNumber.h

unsignedCharValue

get or set the number’s value as/from type unsigned char

@property (atomic) unsigned char unsignedCharValue

Declared In

KKMutableNumber.h

unsignedIntValue

get or set the number’s value as/from type unsigned int

@property (atomic) unsigned int unsignedIntValue

Declared In

KKMutableNumber.h

unsignedIntegerValue

get or set the number’s value as/from type NSUInteger

@property (atomic) NSUInteger unsignedIntegerValue

Declared In

KKMutableNumber.h

unsignedLongLongValue

get or set the number’s value as/from type unsigned long long

@property (atomic) unsigned long long unsignedLongLongValue

Declared In

KKMutableNumber.h

unsignedLongValue

get or set the number’s value as/from type unsigned long

@property (atomic) unsigned long unsignedLongValue

Declared In

KKMutableNumber.h

unsignedShortValue

get or set the number’s value as/from type unsigned short

@property (atomic) unsigned short unsignedShortValue

Declared In

KKMutableNumber.h

Class Methods

numberWithBool:

create a mutable number of type BOOL

+ (id)numberWithBool:(BOOL)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithChar:

create a mutable number of type char

+ (id)numberWithChar:(char)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithDouble:

create a mutable number of type double

+ (id)numberWithDouble:(double)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithFloat:

create a mutable number of type float

+ (id)numberWithFloat:(float)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithInt:

create a mutable number of type int

+ (id)numberWithInt:(int)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithInteger:

create a mutable number of type NSInteger (32-Bit on iOS, 64-Bit on OS X)

+ (id)numberWithInteger:(NSInteger)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithLong:

create a mutable number of type long

+ (id)numberWithLong:(long)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithLongLong:

create a mutable number of type long long (64 bit integer)

+ (id)numberWithLongLong:(long long)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithShort:

create a mutable number of type short

+ (id)numberWithShort:(short)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithUnsignedChar:

create a mutable number of type unsigned char

+ (id)numberWithUnsignedChar:(unsigned char)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithUnsignedInt:

create a mutable number of type unsigned int

+ (id)numberWithUnsignedInt:(unsigned int)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithUnsignedInteger:

create a mutable number of type NSUInteger (32-Bit on iOS, 64-Bit on OS X)

+ (id)numberWithUnsignedInteger:(NSUInteger)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithUnsignedLong:

create a mutable number of type unsigned long

+ (id)numberWithUnsignedLong:(unsigned long)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithUnsignedLongLong:

create a mutable number of type unsigned long long (64 bit integer)

+ (id)numberWithUnsignedLongLong:(unsigned long long)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

numberWithUnsignedShort:

create a mutable number of type unsigned short

+ (id)numberWithUnsignedShort:(unsigned short)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

Instance Methods

initWithBool:

create a mutable number of type BOOL

- (id)initWithBool:(BOOL)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithChar:

create a mutable number of type char

- (id)initWithChar:(char)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithDouble:

create a mutable number of type double

- (id)initWithDouble:(double)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithFloat:

create a mutable number of type float

- (id)initWithFloat:(float)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithInt:

create a mutable number of type int

- (id)initWithInt:(int)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithInteger:

create a mutable number of type NSInteger (32-Bit on iOS, 64-Bit on OS X)

- (id)initWithInteger:(NSInteger)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithLong:

create a mutable number of type long

- (id)initWithLong:(long)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithLongLong:

create a mutable number of type long long (64 bit integer)

- (id)initWithLongLong:(long long)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithShort:

create a mutable number of type short

- (id)initWithShort:(short)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithUnsignedChar:

create a mutable number of type unsigned char

- (id)initWithUnsignedChar:(unsigned char)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithUnsignedInt:

create a mutable number of type unsigned int

- (id)initWithUnsignedInt:(unsigned int)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithUnsignedInteger:

create a mutable number of type NSUInteger (32-Bit on iOS, 64-Bit on OS X)

- (id)initWithUnsignedInteger:(NSUInteger)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithUnsignedLong:

create a mutable number of type unsigned long

- (id)initWithUnsignedLong:(unsigned long)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithUnsignedLongLong:

create a mutable number of type unsigned long long (64 bit integer)

- (id)initWithUnsignedLongLong:(unsigned long long)number

Parameters

number

A number.

Declared In

KKMutableNumber.h

initWithUnsignedShort:

create a mutable number of type unsigned short

- (id)initWithUnsignedShort:(unsigned short)number

Parameters

number

A number.

Declared In

KKMutableNumber.h