Declared in ETObject.h

Overview

NSObject (ETFramework) is a helper class that provides extra methods for better and easiest handling of NSObject.

Attaching extra data

  • Provides helper methods to attach and retrieve objects to specific NSObject.

NSDictionary initialization and manipulation

  • Provides some extra methods to manipulate NSDictionary objects.

Helper methods

  • Also provides some extra methods available as C functions.

Instance Methods

attachUserInfo:

Dynamically attach an object to a NSObject instance using the runtime framework with a predefined key.

- (void)attachUserInfo:(id)userInfo

Parameters

userInfo

The object that will be ‘linked’ to the NSObject instance.

Declared In

ETObject.h

attachUserInfo:forKey:

Dynamically attach an object to a NSObject instance using the runtime framework and links it using the provided key.

- (void)attachUserInfo:(id)userInfo forKey:(char const *)key

Parameters

userInfo

The object that will be ‘linked’ to the NSObject instance.

key

The custom key that will be used to attach the object to the NSObject instance.

Declared In

ETObject.h

initFromDictionary:

Initializes an NSObject using the provided NSDictionary object and KVC.

- (id)initFromDictionary:(NSDictionary *)dictionary

Parameters

dictionary

The NSDictionary object that will be used to ‘feed’ the NSObject properties.

Return Value

An initialized NSObject instance with the properties set to the matching keys/fields provided by the defined NSDictionary.

Declared In

ETObject.h

initFromDictionary:dateFormatter:

Initializes an NSObject using the provided NSDictionary object and KVC with the provided NSDateFormatter.

- (id)initFromDictionary:(NSDictionary *)dictionary dateFormatter:(NSDateFormatter *)dateFormatter

Parameters

dictionary

The NSDictionary object that will be used to ‘feed’ the NSObject properties.

dateFormatter

The NSDateFormatter that will be used to format all the NSDate objects found on the provided NSDictionary.

Return Value

An initialized NSObject instance with the properties set to the matching keys/fields provided by the defined NSDictionary.

Declared In

ETObject.h

updateDataWithDictionary:

Updates an NSObject using the provided NSDictionary object and KVC.

- (id)updateDataWithDictionary:(NSDictionary *)dictionary

Parameters

dictionary

The NSDictionary object that will be used to ‘feed’ the NSObject properties.

Return Value

The NSObject instance with its properties set to the matching keys/fields provided by the defined NSDictionary.

Declared In

ETObject.h

updateDataWithDictionary:dateFormatter:

Updates an NSObject using the provided NSDictionary object and KVC with the provided NSDateFormatter.

- (id)updateDataWithDictionary:(NSDictionary *)dictionary dateFormatter:(NSDateFormatter *)dateFormatter

Parameters

dictionary

The NSDictionary object that will be used to ‘feed’ the NSObject properties.

dateFormatter

The NSDateFormatter that will be used to format all the NSDate objects found on the provided NSDictionary.

Return Value

The NSObject instance with its properties set to the matching keys/fields provided by the defined NSDictionary.

Declared In

ETObject.h

userInfo

Retrieves the object attached to the NSObject instance ‘linked’ with the predefined key.

- (id)userInfo

Return Value

The object attached to the NSObject instance ‘linked’ with the predefined key.

Declared In

ETObject.h

userInfoForKey:

Retrieves the object attached to the NSObject instance using the provided key.

- (id)userInfoForKey:(char const *)key

Parameters

key

The custom key that will be used to try and retrieve a ‘linked’ object with this NSObject instance.

Return Value

The object attached to the NSObject instance ‘linked’ with the provided key.

Declared In

ETObject.h