On Fri, Apr 18, 2008 at 12:56 AM, Adam P Jenkins <[EMAIL PROTECTED]>
wrote:

>
> Can you give an example of where invoking methods on nil objects would
> make sense in a non-error-path situation?   I'm not trying to be
> argumentative here, I'm really curious to know what Objective-C idioms take
> advantage of the nil-swallows-messages behavior.  Thank you.


Delegate messages come to mind. If you're writing a class that may have a
delegate, you can send messages like [delegate didThis] without having to be
concerned about whether a delegate has actually been assigned or not.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________

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