title: NSArrayController NSTableView Core Data Binding integers
body: <p>I have an NSTableView bound to an NSArrayController, which in turn is bound to Core Data. The table displays integer values from core data nicely, but if I edit the numbers in the table I get an error:</p>
  
  <pre><code>Unacceptable type of value for attribute: property = "armorclass"; desired type = NSNumber; given type = NSTaggedPointerString; value = 10.
  </code></pre>
  
  <p>Any suggestions of how I can convert this pointer string back to an Int16 before the Array Controller tries to save it back to Core Data?</p>
  
  <p>I wrote the following ValueTransformer but it's not working properly. I always get the error: Cannot find value transformer with name StringIntegerValueTransformer</p>
  
  <pre><code>class StringIntegerValueTransformer: ValueTransformer {
  
      override class func transformedValueClass() -&gt; AnyClass { //What do I transform
          return String.self as! AnyClass
      }
  
      override class func allowsReverseTransformation() -&gt; Bool { //Can I transform back?
          return false
      }
  
      override func transformedValue(_ value: Any?) -&gt; Any? {
          if let val = value {
              return String(describing: val)
          }
          return "nil"
      }
  
      override func reverseTransformedValue(_ value: Any?) -&gt; Any? { //Revert transformation
          if let val = value {
              return val as? Int16
          }
          return nil
      }
  }
  </code></pre>
  
  <p>fff</p>