NSValueTransformer
is used to transform a value. But what if the transformation needs more contextual information? For example how can a NSValueTransformer
access other objects in the nib, or access the view controller? Is this just not what NSValueTransformer
is meant to be used?
As an example I want to bind a text view's attributed string to an employee's name, using a value transformer to format the name based on the employee's department.
My solution so far has been to just implement a new employeeNameForDisplay
property or so, skipping value transformers altogether.
If that's truly the best solution, I have a hard time understand the value of value transformers. Are they really this limited?