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?
+1
A:
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)
didito
2010-03-05 10:47:28
Take a look at NSDateFormatter too. Bindings and properties could be used to solve this too. In addition to diditos recommendations I would add Cocoa Programming for Mac OS X (3rd Edition)By Aaron Hillegass.
Benedict Cohen
2010-03-05 10:59:52