PDA

View Full Version : Cocoa Bindings pattern math




davbeck
Oct 19, 2009, 07:32 PM
is there any support for math in a binding display path? I would like to format NSTimeInterval as M:SS.



larkost
Oct 19, 2009, 07:57 PM
You can probably do what you want by letting the text field do the work. You just need to add a custom class of NSFormatter (http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSFormatter_Class/Reference/Reference.html) to the field.

davbeck
Oct 19, 2009, 08:14 PM
Oh yeah I forgot about NSFormatter. I haven't used that since I first read Hillegass' book.