Inherits from NSObject
Declared in RKPropertyInspector.h

Overview

The RKPropertyInspector class provides an interface for introspecting the properties and attributes of classes using the reflection capabilities of the Objective-C runtime. Once inspected, the properties inspection details are cached.

The CoreData category augments the RKPropertyInspector class with support for introspecting the property types for NSManagedObject and NSEntityDescription objects.

Tasks

Retrieving the Shared Inspector Instance

Retrieving the Properties and Types for a Class

CoreData Methods

  • – propertyInspectionForEntity:

    Returns a dictionary wherein the keys are the names of attribute and relationship properties and the values are the class used to represent the corresponding property for a given entity.

  • – classForPropertyNamed:ofEntity:

    Returns the class used to represent the property with the given name on the given entity.

Class Methods

sharedInspector

+ (RKPropertyInspector *)sharedInspector
Discussion

Returns the shared property inspector singleton instance.

Return Value

The shared RKPropertyInspector instance.

Declared In

RKPropertyInspector.h

Instance Methods

classForPropertyNamed:ofClass:isPrimitive:

- (Class)classForPropertyNamed:(NSString *)propertyName ofClass:(Class)objectClass isPrimitive:(BOOL *)isPrimitive
Discussion

Returns the Class object specifying the type of the property with given name on a class.

Parameters

propertyName

The name of the property to retrieve the type of.

objectClass

The class to retrieve the property from.

isPrimitive

A pointer to a Boolean value to set indicating if the specified property is of a primitive (non-object) type.

Return Value

A Class object specifying the type of the requested property.

Declared In

RKPropertyInspector.h

classForPropertyNamed:ofEntity:

- (Class)classForPropertyNamed:(NSString *)propertyName ofEntity:(NSEntityDescription *)entity
Discussion

Returns the class used to represent the property with the given name on the given entity.

Parameters

propertyName

The name of the property to retrieve the class for.

entity

The entity containing the property to retrieve the class for.

Return Value

The class used to represent the property.

Declared In

RKPropertyInspector+CoreData.h

propertyInspectionForClass:

- (NSDictionary *)propertyInspectionForClass:(Class)objectClass
Discussion

Returns a dictionary keyed by property name that includes the key-value coding class of the property and a Boolean indicating if the property is backed by a primitive (non-object) value. The RKPropertyInspectorPropertyInfo object for each property includes details about the key-value coding class representing the property and if the property is backed by a primitive type.

Parameters

objectClass

The class to inspect the properties of.

Return Value

A dictionary keyed by property name that includes details about all declared properties of the class.

Declared In

RKPropertyInspector.h

propertyInspectionForEntity:

- (NSDictionary *)propertyInspectionForEntity:(NSEntityDescription *)entity
Discussion

Returns a dictionary wherein the keys are the names of attribute and relationship properties and the values are the class used to represent the corresponding property for a given entity.

Parameters

entity

The entity to retrieve the properties names and classes of.

Return Value

A dictionary containing the names and classes of the given entity.

Declared In

RKPropertyInspector+CoreData.h