Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Stunner

macrumors newbie
Original poster
Sep 14, 2009
22
0
I am having problems adding NSTimeInterval to an NSMutableArray. Here is my code:
Code:
                NSTimeInterval timeDifference;
		timeDifference = [[self.arrayOfTimes objectAtIndex:arrayOfTimesCtr-1] 
						  timeIntervalSinceDate:[self.arrayOfTimes objectAtIndex:arrayOfTimesCtr-2]];
		[self.arrayOfTimeDifferences addObject:timeDifference]; //problem here
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!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.