Hi, I'm doing an application on my Ipad, I'm using NSDate to calculate time interval between 2 touches as below :
in MyFile.h
in MyFile.m
Program received EXC_BAD_ACCESS at:
NSTimeInterval timeInterval = [startTime timeIntervalSinceNow];
I'm not sure what I'm doing wrong here. Thanks for help.
in MyFile.h
Code:
@interface MyFile: CCLayer {
NSDate* startTime;
{
@end
Code:
-(id) init
{
.........
startTime = [NSDate date]; //initialize
..........
}
-(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event
{
NSTimeInterval timeInterval = [startTime timeIntervalSinceNow];
startTime= [NSDate date];
if(timeInterval..........)
return FALSE;
}
Program received EXC_BAD_ACCESS at:
NSTimeInterval timeInterval = [startTime timeIntervalSinceNow];
I'm not sure what I'm doing wrong here. Thanks for help.