Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>a) Divide the value of your timer property into minutes and seconds. Then use an <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSFormatter_Class/Reference/Reference.html" rel="nofollow noreferrer">NSFormatter</a> setup with two leading zeros to create strings from the two numbers (see: <a href="https://stackoverflow.com/questions/524827/how-to-specify-decimal-places-when-formatting-nsnumber-objects">How to specify decimal places when formatting NSNumber objects?</a>). Then use <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/clm/NSString/stringWithFormat:" rel="nofollow noreferrer">stringWithFormat:</a> to put the two strings on either side of a colon.</p> <p>b) Or just divide out each digit of the four (in your example) numbers and put that number in a string with the colon in the correct spot. (so first the tens of minutes, then the minutes, then the tens of seconds, then the seconds)</p> <p>Either of the above could be in a <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/DataFormatting/Articles/CreatingACustomFormatter.html#//apple_ref/doc/uid/20000196" rel="nofollow noreferrer">custom NSFormatter subclass</a> set on the NSTextField or in a method in the view's controller called by an observer (using <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueObserving/Concepts/Overview.html#//apple_ref/doc/uid/20001837" rel="nofollow noreferrer">KVO</a>) of your timer property.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload