BDKeyAssignment

Inherits from:
BDAssignment
NSObject
Conforms to:
NSCoding
BDPropertyListEncoding (informal protocol)
Declared in:
BDRuleEngine/BDKeyAssignment.h

Class at a Glance

A BDKeyAssignment is a special kind of assignment that, when fired, treats its value as a key path and looks up that key path in its context.


Class Description

A BDKeyAssignment is a special kind of assignment that, when fired, treats its value as a key path within the firing context. It looks up the value at that key path, and returns it as the result of firing. This could cause additional rules to be fired.

Be careful not to construct circular rule chains when using BDKeyAssignment. Circular rule chains could cause infinite recursion during rule evaluation, eventually exhausting stack space.


Adopted Protocols

NSCoding
-encodeWithCoder:
-initWithCoder:
 
BDPropertyListEncoding (informal protocol)
-encodeIntoPropertyList:
-initWithPropertyList:owner:
-awakeWithPropertyList:

Method Types

Firing
-fireInContext:

Instance Methods

fireInContext:

- (id)fireInContext:(BDRuleContext *)context

"Fires" the assignment in the given context. In BDKeyAssignment, this causes the assignment's value to be treated as a key path into the context. The value at this key path is looked up within the context - possibly causing additional rules to be fired - and is returned as the result of firing this assignment.

If the value of this assignment is not a string, no lookup is performed, and nil is returned.


Copyright © 2002, 2003 bDistributed.com, Inc. All rights reserved worldwide.