I'm trying to get the time interval between two NSDates, namely previousActivity.stopTime
and previousActivity.startTime
. I'm getting an error with this code:
NSTimeInterval *previousActivityDuration = [previousActivity.stopTime timeIntervalSinceDate:previousActivity.startTime];
Here's the error message:
"Initializing 'NSTimeInterval *' (aka 'double *') with an expression of incompatible type 'NSTimeInterval' (aka 'double')"
I don't get it; If NSTimeInterval is aka 'double', how is the initialization expression incompatible, and how do I fix it?
Many thanks!
Edit:
Per @Rmaddy's comment, I removed the asterisk. Then I get this error in the line immediately following:
Assigning to 'NSNumber *' from incompatible type 'NSTimeInterval' (aka 'double')
Here's the offending line:
previousActivity.duration = previousActivityDuration;