Re: NSValueTransformer used with table colulms
Re: NSValueTransformer used with table colulms
- Subject: Re: NSValueTransformer used with table colulms
- From: mmalcolm crawford <email@hidden>
- Date: Thu, 25 Mar 2004 12:34:49 -0800
On Mar 25, 2004, at 11:58 AM, Bjoern Kriews wrote:
On 25.03.2004, at 18:41, mmalcolm crawford wrote:
On Mar 25, 2004, at 2:12 AM, Mike Thorpe wrote:
When it runs I get garbage in the column for non-zero values. It
seems as if the NSTableView still thinks it's an NSNumber instead of
an NSString.
Do you have a formatter or something else attached to the column?
Malcolm, could you kindly explain if and how one can use formatters
with bindings in place ?
Try it :-)
For example, I have an NSTextField (non-editable) where I'd like
to format the contents in a way that NSNumberFormatter already
supplies.
Yes -- it works exactly as before, see several examples at:
<
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>
The binding "supplies" the original value (possibly piped through a
value transformer), the formatter determines how to display it.
I don't want to use ValueTransformers for this because
ValueTransformers can not easily be customized, AFAIK I have
to register a different instance for each slight change in formatting.
Especially for Numbers and Dates I like to use what is available in IB.
Value transformers and formatters perform different functions. You
could have a text field that used both a value transformer to change a
value, and then a formatter to present it. See:
<
http://developer.apple.com/documentation/Cocoa/Conceptual/
ValueTransformers/index.html>
mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.