Sunday, June 5, 2011

NSTimeInterval as Not a Number

This is something very simple. Took me a long time and several attempts to find the answer, most likely because I wasn't able to phrase the question in the correct way.

Anyway - occasionally you are dealing with a NSTimeInterval, which happen to have value Not a Number.

Debugger shows "nan", google search finds "NaN, but the correct answer is "NAN":
if (aTimeInterval == NAN)
{
    // don't use timeInterval
}
Sometimes the most important thing is asking the right questions.

No comments:

Post a Comment