MLIMRuntimeObject Class Reference

Inherits from NSObject
Declared in MLIMRuntimeObject.h

Overview

Base class to support dynamic property storage.

– initWithDictionary:

Initializes a newly allocated runtime object with a dictionary.

- (instancetype)initWithDictionary:(NSDictionary<NSString*,id> *)dictionary

Parameters

dictionary

A dictionary containing the keys and values with which to initialize the new runtime object.

Return Value

An initialized runtime object containing the entries found in dictionary.

Declared In

MLIMRuntimeObject.h

– dictionaryRepresentation

Returns a dictionary which represents a MLIMRuntimeObject. The dictionary contains all key-values except the properties which have ivars.

- (NSDictionary<NSString*,id> *)dictionaryRepresentation

Return Value

A dictionary represents the receiver.

Declared In

MLIMRuntimeObject.h

– addEntriesFromDictionary:

Adds to the receiving runtime object the entries from the dictionary.

- (void)addEntriesFromDictionary:(NSDictionary<NSString*,id> *)dictionary

Parameters

dictionary

The dictionary from which to add entries

Discussion

If runtime object and the dictionary contain the same key, the runtime object’s previous value object for that key is sent a release message, and the new value object takes its place.

Declared In

MLIMRuntimeObject.h

– keyPathForProperty:

Return the property by default. Subclass can overide the method to return a different keyPath for a property.

- (NSString *)keyPathForProperty:(NSString *)property

Parameters

property

The name of dynamic property.

Return Value

A key path of the form relationship.property, for example department.name

Declared In

MLIMRuntimeObject.h

– valueForPropertyName:

Returns the object associated with a given property name. The method will get keyPath for the property and then call objectForKey:.

- (nullable id)valueForPropertyName:(NSString *)propertyName

Parameters

propertyName

The name of a property

Return Value

The value object associated with the given property.

Declared In

MLIMRuntimeObject.h

– setValue:forPropertyName:

Sets the value associated with a given property.

- (void)setValue:(nullable id)value forPropertyName:(NSString *)propertyName

Parameters

value

The new value object for the property. A strong reference to the value object is maintained by MLIMRuntimeObject.

propertyName

The property name, MUST NOT be nil.

Discussion

Setting nil for key results in unsetting the key on the object. If you need to represent a nil value, use NSNull.

Declared In

MLIMRuntimeObject.h

– objectForKey:

Returns the object associated with a given key.

- (nullable id)objectForKey:(NSString *)key

Parameters

key

The key that the object is associated with.

Return Value

The value associated with the given key, or nil if no value is associated with key.

Declared In

MLIMRuntimeObject.h

– setObject:forKey:

Sets the object associated with a given key.

- (void)setObject:(nullable id)object forKey:(NSString *)key

Parameters

object

The object for key. A strong reference to the object is maintained by MLIMRuntimeObject.

key

The key. Raises an NSInvalidArgumentException if key is nil.

Discussion

Setting nil for key results in unsetting the key on the object. If you need to represent a nil value, use NSNull.

Declared In

MLIMRuntimeObject.h

– objectForKeyedSubscript:

In LLVM 4.0 (XCode 4.5) or higher allows myObject[key].

- (nullable id)objectForKeyedSubscript:(NSString *)key

Parameters

key

The key.

Declared In

MLIMRuntimeObject.h

– setObject:forKeyedSubscript:

In LLVM 4.0 (XCode 4.5) or higher allows myObject[key] = value

- (void)setObject:(nullable id)object forKeyedSubscript:(NSString *)key

Parameters

object

The object. A strong reference to the object is maintained by MLIMRuntimeObject.

key

The key. Raises an NSInvalidArgumentException if key is nil.

Discussion

Setting nil for key results in unsetting the key on the object. If you need to represent a nil value, use NSNull.

Declared In

MLIMRuntimeObject.h