title: Type casting for Core Data attribute setting
body: <p>I am trying to set a Core Data attribute but am getting incompatible type errors. I have a float attribute in a Core Data entity on iPhone 3.0. Core Data auto-generates an interface for a managed data object that provides property access to it:</p>
  
  <pre><code>@property (nonatomic, retain) NSNumber * volume;
  </code></pre>
  
  <p>and an implementation for it:</p>
  
  <pre><code>@dynamic volume;
  </code></pre>
  
  <p>I create an instance of the managed data object, which I call attrVolume, and use that to access that Core data entity attribute through a Core Data managed object context:</p>
  
  <pre><code>[attrVolume setVolume:[txtVolume.text floatValue]];
  </code></pre>
  
  <p>The compilation error is:</p>
  
  <blockquote>
    <p>incompatible type for argument 1 of 'setVolume:'</p>
  </blockquote>
  
  <p>Any ideas how to cast that value and not get that compilation error? Is there a way to cast to NSNUmber?</p>
  
  <p>Any help appreciated // :)</p>