On Dec 30, 2008, at 12:06 AM, Steve Cronin wrote:

Ken - I don't understand what you said about the method's signature's compliance with NSObject _protocol_. I looked at the protocol definition in the documentation and I just don't understand well enough to see what I could do to "side-step" the warnings,
Would you be willing to spend another sentence or two on that?

Sure.  Sorry if I was unclear.

First, I only underlined "protocol" to make sure you looked in the right place in the documentation. The -performSelector:... methods are documented as part of the NSObject protocol, not the NSObject class.

Second, the documentation for the -performSelector: method says the following:

The aSelector argument should identify a method that takes no arguments. For methods that return anything other than an object, useNSInvocation.

That's saying that the selector you pass to -performSelector: should be for a method which takes no arguments and returns an object pointer. This -- the number and types of arguments and return type -- is the "signature" of the method.

The -performSelector:withObject: and - performSelector:withObject:withObject: methods similarly describe the signature requirements for the method identified by the selector you pass.

So, if you are working with a selector for a method which matches the signature required by one of those methods, then you can safely use those methods. Doing so is a way to invoke the method without getting the compiler warning that was troubling you.

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 arch...@mail-archive.com

Reply via email to