On Nov 29, 2009, at 1:44 PM, Jericho Hasselbush wrote: > I've been considering the best way to integrate user's choice of units in my > app (metric and standard) and have yet to figure out a clean way of doing it. > > I am considering using a custom formatter that will change it's behavior > based on a globally accessible variable holding the type of system - probably > in the App Delegate, since the app will store the data in the same units no > matter what. The respective controllers can watch the keyValue of the app > delegate and update their respective views when the App Delegate's variable > changes. > > Is this an acceptable use of a custom formatter, or am I making this harder > than necessary?
Probably better to use an NSValueTransformer, which gives you reverse transformation as well. If you are using bindings you get this (forward & reverse transforms) for free. You will probably still want a formatter, if just to show the correct suffix (e.g. "in" vs "cm"). HTH, Keary Suska Esoteritech, Inc. "Demystifying technology for your home or business" _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
