Optional methods
Optional methods
- Subject: Optional methods
- From: "Mike R. Manzano" <email@hidden>
- Date: Thu, 21 Feb 2008 07:57:44 -0800
Hello,
I'd like to create an informal protocol where objects can have an
optional method. Senders of the object would be required to send
respondsToSelector: to find out if am object implements the method
before calling it.
The problem is that the compiler complains that the method doesn't
exist if a sender actually does send that message to an object.
I know about the pattern to shut the compiler up: create a category on
NSObject with the method defined, but if I were to do that, wouldn't
respondsToSelector: always return YES for that method, defeating the
point of calling respondsToSelector: in the first place?
Thanks,
Mike
_______________________________________________
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