Charles Steinman <mailto:[EMAIL PROTECTED]> wrote (Tuesday, August 5, 2008 4:20 PM -0700):

--- On Tue, 8/5/08, James Bucanek <[EMAIL PROTECTED]> wrote:

In your original code, you had

SEL closeSelector = @selector(close);
if ([SuperSocket
instancesRespondToSelector:closeSelector]) {
...

This does not, as I think you believe, test to see if an
object of the class SuperSocket responds to the -close message. In

fact, it tests to see if the class object for SuperSocket responds to the +close message.

That isn't correct. The +instancesRespondToSelector: method tells whether *instances* of a class respond to a selector. To test whether the class object responds to a given selector, you'd use [SuperSocket respondsToSelector:].

My bad, you're absolutely correct. I just misread it as respondsToSelector:.

--
James Bucanek

_______________________________________________

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