Re: A hillegass challenge
Re: A hillegass challenge
- Subject: Re: A hillegass challenge
- From: Greg Guerin <email@hidden>
- Date: Fri, 4 Dec 2009 10:46:19 -0700
Michael de Haan wrote:
My question pertains to knowingly setting an object to NULL and
then knowingly sending it a message as an acceptable technique. (If
this is not done, drawRect will simply show the oval as if it was
still being actively drawn).
Also see:
http://en.wikipedia.org/wiki/Null_Object_pattern
In this particular case, it's probably overkill to create a do-
nothing class. Other circumstances might make it more sensible. For
example, you have a collection that can't contain nil, yet you still
need the do-nothing behavior from contained objects.
I also recommend changing your comment from the self-evident "sets
the current bezierPath to nil", to instead give the REASON for
setting bezierPath to nil, e.g. "a nil bezierPath always does nothing
in drawRect:".
-- GG
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden