|
#1
| ||||
| ||||
| Formatters in IB
Does anyone know to creat a formatter? I want a formatter on a text field so that entries must be floats. I downloaded a source project from cocoadevcentral.com and when you click a textfield it has Formatter in the info pallete with Attributes, Connections, Size, etc.
|
|
#2
| |||
| |||
|
You have to subclass NSFormatter, instantiate it, and then connect the text field's "formatter" attribute to it. Then, to have it do your specific kind of formatting, I think you just have to override some of NSFormatter's methods. URL for formatting info: http://developer.apple.com/techpubs/...ing/index.html |
|
#3
| |||
| |||
|
Or you could just drag the Number formatter in the tools palette in Interface Builder directly onto the text field. Then, mess with the settings in the Info window.
|
|
#4
| ||||
| ||||
|
I finally figured that out. I did not know those things were formatters. Thanks.
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|