NSObject(Extensions) Category Reference

Declared in NSObject+Extensions.h

Overview

NSObject extensions.

– isNotNil

Determines whether or not the receiver has a value that is not NSNull.

- (BOOL)isNotNil

Return Value

Whether or not the object has a non-NSNull value.

Discussion

Determines whether or not the receiver has a value that is not NSNull.

Declared In

NSObject+Extensions.h

+ selectorBelongsToProtocol:protocol:

Determines whether the selector given belongs to the protocol given.

+ (BOOL)selectorBelongsToProtocol:(nonnull SEL)selector protocol:(nonnull Protocol *)protocol

Parameters

selector

The selector to check.

protocol

The protocol to check the existance of the selector in.

Return Value

true if the selector is a member of the protocol.

Discussion

Determines whether the selector given belongs to the protocol given.

Declared In

NSObject+Extensions.h

+ object:isEqualToObject:

Determines whether two objects are equal to each other. Both the pointer equivalence and object equality are checked. nil values for either or both objects are fully supported.

+ (BOOL)object:(nullable id)objectA isEqualToObject:(nullable id)objectB

Parameters

objectA

The first object to compare.

objectB

The second object to compare.

Return Value

true if the two objects are equal, false if not.

Discussion

Determines whether two objects are equal to each other. Both the pointer equivalence and object equality are checked. nil values for either or both objects are fully supported.

Declared In

NSObject+Extensions.h

– setMetaValue:withKey:

Sets the meta value of the object for the specified key.

- (void)setMetaValue:(nullable id)value withKey:(nonnull NSString *)key

Parameters

value

The value to set. If a nil value is passed the key-value pair is removed.

key

The key to set the value for.

Discussion

Sets the meta value of the object for the specified key.

Declared In

NSObject+Extensions.h

– metaValueForKey:

Gets the meta value of the object for the specified key. Returns nil if a value does not exist for the key.

- (nullable id)metaValueForKey:(nonnull NSString *)key

Parameters

key

The key to retrieve the value for.

Return Value

The retrieved value, or nil if it does not exist.

Discussion

Gets the meta value of the object for the specified key. Returns nil if a value does not exist for the key.

Declared In

NSObject+Extensions.h