Pergunta

I want to store CFAbsoluteTime in NSMutablearray. Can I add like this ?

CFAbsoluteTime time = CFAbsoluteTimeGetCurrent();
[tapTimes addObject:[NSNumber numberWithDouble:(double)time]];

If so, after I store that, I need to retrieve that one and convert to CFAbsoluteTime for later calculation. I would like to know how to do.

Foi útil?

Solução

Your approach is correct. To get the value back as a CFAbsoluteTime, do:

CFAbsoluteTime time = [[tapTimes objectAtIndex:…] doubleValue];
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top