On Tue, Dec 9, 2008 at 11:34 AM, I. Savant <[EMAIL PROTECTED]> wrote:
>  Also, the custom view that draws the rectangle should probably
> maintain this property itself (such as -rectColor). It's probably
> trivial for your current application (which looks like a learning
> exercise) but has performance implications in a full-fledged app. This
> way, you can always use [self rectColor] instead of all the messaging
> overhead of asking preferences each time you draw.

I must object to this justification. It may well be better design to
do things this way, but doing it because it's supposedly faster is
pointless. There is no way that fetching a value from NSUserDefaults
(which is basically just an NSDictionary lookup) will be even vaguely
noticeable against the cost of throwing a few thousand pixels onto the
screen. Even if it were slower, contorting the code like this without
having profiled the code and demonstrated that this is in fact a
significant slowdown is bad practice.

Mike
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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]

Reply via email to