Hello,
I'm trying to compare the timeInterval to an integer value, so I try and convert the timeInterval to an integer and compare. But I'm getting an error 'Cannot convert to a pointer type':
NSTimeInterval timeInterval = [startTime timeIntervalSinceNow];
int intSecondsElapsed = [timeInterval intValue]; // Error here !!!!
if ([counterInt != intSecondsElapsed])
{
// Do something here...
}
How would go about doing this ?
EDIT: Include more detail relating to Execute error.
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
//[formatter setDateFormat:@"HH:mm:ss"];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
startTime = [NSDate date];
[formatter release];
if ([deviceType isEqualToString:@"iPhone 4"]||[deviceType isEqualToString:@"iPhone Simulator"])
{
int intSecondsElapsed = (int)[startTime timeIntervalSinceNow];
if (counterInt != intSecondsElapsed)
{
counterInt = intSecondsElapsed;
}
}