Search code examples
iphonensnumbernstimeinterval

iPhone : integer overflow in expression


I get integer overflow in expression for NSTimerInterval, which is really a double.

NSTimerInterval paymentTermsInMilliSeconds = 30 * 24 * 60 * 60 * 1000; 

What's the best way to handle timer interval in iPhone?


Solution

  • Use,

    NSTimerInterval paymentTermsInMilliSeconds = 30 * 24 * 60 * 60 * 1000.0; 
    

    Hope, will solve the problem.