I am using CoreData and I have an NSManagedObject of type Thing. When I set a breakpoint I can console "po aThing" and it shows the data stored.
{
thingID = 5181c56063ab02c4d1000016;
distance = "2.075121";
lat = "37.815834";
lng = "-122.406417";
}
But, if I try to access the lat or lng (which are doubles in Core Data). I get "nan" returned. If I try "po aThing.lat" the console shows nan.
If I try "po aThing.thingID" the console shows 5181c56063ab02c4d1000016.
If I try to assign like newThing.lat = aThing.lat then newThing.lat becomes nan.
I am guessing it has to do with the data be a double?
UPDATE:
Here is how my .h had properties
@property (nonatomic) double lat;
@property (nonatomic) double lng;
Here is how I was using them
coordinate.latitude = thing.lat;
coordinate.longitude = thing.lng;
Here is how I changed them
@property (nonatomic) double *lat;
@property (nonatomic) double *lng;
And how I use them now and it seems to work
coordinate.latitude = *(thing.lat);
coordinate.longitude = *(thing.lng);