- Inherits from:
- BDAssignment
- NSObject
- Conforms to:
- NSCoding
- BDPropertyListEncoding (informal protocol)
- Declared in:
- BDRuleEngine/BDKeyAssignment.h
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.
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.
- NSCoding
- -encodeWithCoder:
- -initWithCoder:
- BDPropertyListEncoding (informal protocol)
- -encodeIntoPropertyList:
- -initWithPropertyList:owner:
- -awakeWithPropertyList:
- Firing
- -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.