You're attempting to make an NSTimeInterval
pointer variable, but what you really want is just an NSTimeInterval
variable. So remove the asterisk like this:
NSTimeInterval previousActivityDuration = [previousActivity.stopTime timeIntervalSinceDate:previousActivity.startTime];
Your code was complaining because the types were different. Usually we only use pointers for Objective-C objects, and only where necessary do we generally use pointers for primitive types such as double
s and such.