title: How to Save a Generic Measurement<Unit> in Core Data?
body: <p>How does one save and retrieve a generic Measurement in Core Data?</p>
  
  <p>What I'm looking to do is save either a <code>Measurement&lt;UnitMass&gt;</code> or a <code>Measurement&lt;UnitVolume&gt;</code>.</p>
  
  <p>As can be seen in the image below CoreData is set to accept a Generic <code>Measurement&lt;Unit&gt;</code></p>
  
  <p><a href="https://i.stack.imgur.com/TECzR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TECzR.png" alt="Generic Measurement in Core Data"></a></p>
  
  <p>However I'm getting an error when I go to set the value of the measure. Saying that I'm not allowed to do this. I thought the purpose of generics was to support uses like this.</p>
  
  <p>What am i missing?</p>
  
  <p><a href="https://i.stack.imgur.com/WVYU5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WVYU5.png" alt="enter image description here"></a></p>