On Sep 10, 2008, at 10:24 AM, Michael Ash wrote:

On Wed, Sep 10, 2008 at 11:13 AM, Ken Thomases <[EMAIL PROTECTED]> wrote:
On Sep 10, 2008, at 9:52 AM, Michael Ash wrote:

And lastly, I recommend filing a bug against the documentation in this case. NSInvocation is not really suited for this particular task, and
I don't understand why they would recommend it here.

One possible reason is for proxying or otherwise handling unimplemented methods dynamically. There is a well-defined mechanism for what happens if you send a message to an object that doesn't directly implement a method for that message. A class can decide to forward the message, or it can do something funky in an override of doesNotRecognizeSelector:. That mechanism
does kick in for performSelector:… and NSInvocation but doesn't for
methodForSelector:.

Works fine for me:

Interesting. I guess I was misled by the part of the methodForSelector: documentation where it suggests using respondsToSelector: to test if the selector is "valid".

Never mind. ;)

Cheers,
Ken_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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