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 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]

Reply via email to