好的,我想用 aNSTextfield和 a建立一个倒数计时器NSStepper来增加它。两者都绑定到ModelKeyPathInterface中的相同 int 属性Builder。要将 int 值输出格式化为 00:00:00,我NSDateFormatter在.IBNSTextfield
它正在工作,但是当我运行应用程序时,在我的情况下添加了与 GMT +001 的差异。int 值应为 0,但 textField 显示 01:00:00
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
self.countdownTimer = [[Timer alloc] init];
[self.countdownTimer setTimerCount:0];
}
我已经用这个解决方案以编程方式完成了它:Convert Seconds Integer To HH:MM, iPhone
但我想使用NSDateFormatter. 帮助表示赞赏。