-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hello!
I have my timer code set up, and it's all kosher, but I want my label to display "Minutes : seconds" instead of just seconds.
-(void)countDown{
time -= 1;
theTimer.text = [NSString stringWithFormat:@"%i", time];
if(time == 0)
{
[countDownTimer invalidate];
}
}
I've…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have a schedule cache stored in a pList.
For the example below, I have a schedule time of April 13, 2010 2:00PM and Aril 13, 2010 2:05PM. How can I add both of these to a queue to fire on their own?
item 0
-Hour
--14
-Minute
--00
-Month
--04
-Day
--13
-Year
--2010
item 1
-Hour
--14
-Minute
--05
-Month
--04
-Day
--13
-Year
--2010
this…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I schedule a timer with NSTimer's function in viewWillAppear as follows:
minutesTimer = nil;
minutesTimer = [NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(updateScrollViewItems) userInfo:NULL repeats:YES];
With this function call, I expect it to call the selector updateScrollViewItems…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have come across an awkward situation where I would like to have a class with an NSTimer instance variable that repeatedly calls a method of the class as long as the class is alive. For illustration purposes, it might look like this:
// .h
@interface MyClock : NSObject {
NSTimer* _myTimer;
}
-…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I have the following code:
[NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(timerCount:) userInfo:nil repeats:YES];
-(void)timerCount:(NSTimer *)timer
{
NSTimeInterval dt = [timer timeInterval];
// do something
}
The NSTimeInterval I got will be 0.5, the time…
>>> More