NSObject HOM Category

Authors

Quentin Mathe (qmathe@club-internet.fr)
A category which extends NSObject with various High Order Messages.

Copyright: (C) 2009 Quentin Mathe

Software documentation for the NSObject(HOM) category

NSObject(HOM)

Declared in:
NSObject+HOM.h

@group High Order Messaging and Blocks

Method summary

ifResponds 

- (id) ifResponds;

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