Re: Value With Pattern formatting with Bindings
Re: Value With Pattern formatting with Bindings
- Subject: Re: Value With Pattern formatting with Bindings
- From: mmalcolm crawford <email@hidden>
- Date: Wed, 8 Dec 2004 17:09:19 -0800
On Dec 8, 2004, at 4:44 PM, Fred Glover wrote:
I am successfully binding NSTextViews to my model data path with the
Value With Pattern - DisplayPatternValue1 method in IB.
However, for the life of me I can't make printf type format statements
work.
[...]
Ideally I'd like it formatted something like 33.33%. And no, it's not
possible to round my model data to the desired number of decimal
places or digits.
Do I need a custom formatter?
Without testing, two possibilities come to mind:
(a) Use a value transformer for that element in the pattern (the output
value would be a suitably formatted string);
(b) If you have a particularly complicated string to display (that's
based solely on the model object), then implement a custom description
method (not a method called 'description', just one the returns a
description in the right format) and bind to that instead.
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden