qmathe@club-internet.fr
)A category which extends NSObject with various High Order Messages.
Copyright: (C) 2009 Quentin Mathe
- Declared in:
- NSObject+HOM.h
@group High Order Messaging and Blocks
Returns the receiver itself when it can respond
to the next message that follows
-ifResponds
, otherwise returns nil
.
If we suppose the Cat class doesn't implement
-bark
, then
-ifResponds
would return nil
and thereby
-bark
be discarded: [[cat ifResponds] bark];
Now let's say the Dog class implement
-bark
, the
-ifResponds
will return 'dog' and
-bark
be executed: [[dog ifResponds] bark];