I am having problems adding NSTimeInterval to an NSMutableArray. Here is my code:
And the error I get from the problematic line is "error: incompatible type for argument 1 of 'addObject:'". So what I get from this is that it wants an object rather than a value, but I have looked through the array documentation and there are only addObject methods. Therefore I am wondering how I can append a regular value, like an int, or an NSTimeInterval for that matter, to an array. Thanks!
Code:
NSTimeInterval timeDifference;
timeDifference = [[self.arrayOfTimes objectAtIndex:arrayOfTimesCtr-1]
timeIntervalSinceDate:[self.arrayOfTimes objectAtIndex:arrayOfTimesCtr-2]];
[self.arrayOfTimeDifferences addObject:timeDifference]; //problem here