1

OK, I want to build a countdown timer with a NSTextfield and a NSStepper to increase it. Both have bindings to the same int property in ModelKeyPath in Interface Builder. To format the int value output to 00:00:00, I added a NSDateFormatter in IB to the NSTextfield.

It's working, but when I run the application, the difference to GMT in my case +001 is added. The int value should be 0, but the textField shows 01:00:00

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    // Insert code here to initialize your application
    self.countdownTimer = [[Timer alloc] init];

    [self.countdownTimer setTimerCount:0];
}

I've done it programatically with this solution: Convert Seconds Integer To HH:MM, iPhone but i want to use the NSDateFormatter. Help appreciated.

Community
  • 1
  • 1
seinfeld
  • 1,686
  • 1
  • 17
  • 18

1 Answers1

1

Set the formatter's time zone to be your current time zone.

There isn't a way to do that in IB, but you can create an outlet for the date formatter and set the time zone in -awakeFromNib.

paulmelnikow
  • 16,895
  • 8
  • 63
  • 114