Reputation: 1810
I am trying to store some values from textfields as doubles and floats and I cannot get past the above error.
I have defined the property to match the attribute in my cordata database:
@NSManaged var custjobcost: Double
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.
newItem.custjobcost = (textfield.text as NSString).doubleValue
I have also the same thing, but with float and floatvalue instead.
Upvotes: 1
Views: 461
Reputation: 6669
Try this
newItem.custjobcost = textfield.text.bridgeToObjectiveC().doubleValue
Upvotes: 1