how to continuously display time in cocoa?
I have some code to control some buttons for an interface, but I would like to add a small text label that continuously displays time by hh:mm:ss. How do I do 开发者_如何转开发that?
well, i think you should take a look at some cocoa development related books or websites - like cocoadev cocoadevcentral cocoabuilder ...
in short: define your
IBOutlet NSTextField* timeLabel;
in your controller class and hook it up to the NSTextField
in your NIB
.
take a look at NSDate
and update it (via a NSTimer
or your draw loop)
精彩评论