On Oct 22, 2009, at 10:53 AM, Bill Bumgarner wrote:

Selectors are strings, but it is an implementation detail.

The runtime uniques the strings such that there is only ever one instance of, say, the "drawRect:" selector floating about. Thus, the runtime can use pointer comparison to determine selector equality.

It is an implementation detail though. One that is exceedingly unlikely to ever change but, still, an implementation detail.

Use the Objective-C runtime API if you want to do selector comparison.

sel_isEqual(), IIRC.

b.bum

http://twitter.com/gparker/status/2400099786

"Ignore bbum. We hereby promise never to break == for SEL. (But SEL is not char*. We will break that.)"

And now that it's on the mailing lists, it can be considered part of Apple's official documentation. ;-)

-Jeff

_______________________________________________

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