image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Software Programming & Web Scripting

Reply
 
LinkBack Thread Tools
  #1  
Old May 18th, 2002, 05:09 PM
zots's Avatar
Re-member
 
Join Date: Jun 2001
Location: Ft Lauderdale
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
zots is on a distinguished road
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.
Reply With Quote
  #2  
Old May 18th, 2002, 05:40 PM
Registered User
 
Join Date: Jan 2002
Location: Berkeley, CA
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
serving2masters is on a distinguished road
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
Reply With Quote
  #3  
Old May 21st, 2002, 11:24 AM
Registered User
 
Join Date: Nov 2000
Posts: 948
Thanks: 0
Thanked 0 Times in 0 Posts
kainjow is on a distinguished road
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.
Reply With Quote
  #4  
Old May 21st, 2002, 03:49 PM
zots's Avatar
Re-member
 
Join Date: Jun 2001
Location: Ft Lauderdale
Posts: 94
Thanks: 0
Thanked 0 Times in 0 Posts
zots is on a distinguished road
I finally figured that out. I did not know those things were formatters. Thanks.
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 09:13 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.