I have a NSTimeInterval
and I have a JSON value 1257808000000
.
I do this:
NSTimeInterval *myTimestamp = [myJSON objectForKey:@"thetimestamp"];
But I get this warning:
Incompatible pointer types initializing 'NSTimeInterval *' (aka 'double *')
with an expression of type 'id'
How can I solve this problem?
Best Regards.
NSTimeInterval is actually a double value. It's not an object.
NSTimeInterval myTimestamp = [[myJSON objectForKey:@"thetimestamp"] doubleValue];
if your object for key @"thetimestamp"
is a NSString
or NSNumber
then
NSTimeInterval myTimestamp = [[myJSON objectForKey:@"thetimestamp"] doubleValue];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With