How to access the remaining time of a non repeating NSTimer
ios, nstimer, objective-c, uibutton
Solution
This is generally not how you would solve this.
Create a repeating NSTimer set to the resolution at which you want to update the button instead.
So for instance, if you want your button to change every second until zero, create a NSTimer like so:
NSTimer *timer = [NSTimer timerWithInterval:1.0 target:self selector:@selector(updateButton) userInfo:nil repeats:YES];
Then implement `updateButton`; basically have a counter for remaining seconds, and every time `updateButton` gets called, decrease the counter by one, and update the title of the button.
Problem
I'm trying to access the remaining time of an NSTimer X. I want to update the title of a button every second to reflect remaining `mm:ss` until zero. I couldn't find anything here. For example: `[btY setTitle:[What to insert here?] forState:UIControlStateSelected];` Or would you rather solve this in a different way?