ajrlewis
ajrlewis

Reputation: 3058

NSManaged Core Data -

I have an entity with an attribute value of type "Double". Why, when I create an NSManagedObject subclass for this does it change to an NSNumber?

@NSManaged var value: NSNumber

Thanks.

Upvotes: 1

Views: 314

Answers (1)

The Mach System
The Mach System

Reputation: 6963

With new version of Xcode you no longer can store have types of Integer, Double, Bool when creating a NSManagedObject subclass. They are all declared as NSNumber

You can convert them to double by calling doubleValue function:

let myDouble = value.doubleValue

Upvotes: 1

Related Questions