Reputation: 1
I'm trying to initialize an NSTimeInterval with this code:
NSTimeInterval *timeStamp = [[NSDate date] timeIntervalSince1970];
but it keeps throwing an error:
Initializing 'NSTimeInterval *' (aka 'double *') with an expression of incompatible type 'NSTimeInterval' (aka 'double')
How do i fix this?
Upvotes: 0
Views: 720
Reputation: 318854
NSTimerInterval
is a primitive type, not an object type. No need for the pointer, just as the error states. You want:
NSTimeInterval timeStamp = [[NSDate date] timeIntervalSince1970];
Upvotes: 7