Lots o' Formatters
Lots o' Formatters
- Subject: Lots o' Formatters
- From: Jonathan Jackel <email@hidden>
- Date: Sun, 14 Sep 2003 20:56:22 -0400
I have an app with lots of text fields and table columns, and
practically all of them have a formatter of some sort. The formatters
fall into a few categories, e.g., number formatter with two decimal
places, number formatter with two decimal places and currency symbol,
date formatter with short date format.
I have dropped formatters on the relevant cells and configured them
individually, but it seems to me that it might be better to instantiate
a few formatters in IB, connect them to the cells' formatter outlet,
and configure them in awakeFromNib. Several cells would share the same
formatter. This would make it relatively easy to change the format of
all cells in a category when the user changes preferences. If the user
wants three decimal places for non-currency fields instead of two, you
just change that formatter's format string and all the cells change
their format.
Plus, since I would only instantiate only about 5 formatters instead of
attaching a dedicated one to each cell, it should be a little more
efficient on memory.
Any reason not to do it this way?
Jonathan
_______________________________________________
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.