title: Why am I getting EXC_BAD_ACCESS error when converting to a float or a double? (In Swift)
body: <p>I am trying to store some values from textfields as doubles and floats and I cannot get past the above error.</p>
  
  <p>I have defined the property to match the attribute in my cordata database:</p>
  
  <pre><code>@NSManaged var custjobcost: Double
  </code></pre>
  
  <p>When I am mapping the properties in order to save them, I am using the following code, but it will not accept it - on runtime, I get the error indicated above.</p>
  
  <pre><code>newItem.custjobcost = (textfield.text as NSString).doubleValue
  </code></pre>
  
  <p>I have also the same thing, but with float and floatvalue instead.</p>