문제

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.

도움이 되었습니까?

해결책

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

CFAbsoluteTime time = [[tapTimes objectAtIndex:…] doubleValue];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top