nstimeinterval

Actually using UIDatePickerModeCountDownTimer as a timer

I am just trying to make a timer. I would like to use UIDatePickerModeCountDownTimer mode of the UIDatePicker, so that when the user simply selects say 15 mins in the picker, they are passed back to a screen that shows the value of 15 mins in a label that they can then count down from. As I have tried to get the value from the DatePicke...

How to display NSTimeInterval binding as NSDate in InterfaceBuilder?

I handle a lot of time stamps that I store as NSTimeInterval. NSDateComponents* comps = [[NSDateComponents alloc] init]; [comps setYear: .... NSDate* date = [gregorian dateFromComponents:comps]; NSTimeInterval timeStamp = [date timeIntervalSinceReferenceDate]; Interface Builder has a table view binding to the variable of the time stam...

Using mod operator in iOS app

I have an NSTimeInterval that is stored as a double. I would like to get the amount of minutes that are inide of the second value using the % operator. minutes = secondValue % 60; where minutes is declared as double minutes The result is that XCode says "Invalid operands to binary %" Thoughts? ...

Trouble comparing TimeInterval to Integer

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 ([counte...

iPhone timeIntervalSinceDate not throwing error, or working

I'm trying to find the difference between two NSDates. This worked once and printed the difference, but has never worked again. I don't remember changing any thing after the one time it worked. Any ideas? Oh, and it doesn't throw an error, and if I comment out this snippet everything works. //----------- Touches Begin - (void)to...