On Dec 17, 2008, at 8:03 PM, Michael Ash wrote:


- (void)windowShouldClose:(id)window
{
if ([[textField stringValue] isEqualTo: @"0:00:00" || @"0.00000" ])

One on the above line:

warning: passing argument 1 of 'isEqualTo:' makes pointer from integer
without a cast

Please accept my profuse apologies for jumping in with a completely tangential question here, but something has always made me curious. I see this periodically, and I always wonder: why do people sometimes use -isEqualTo where they could be using -isEqual: or -isEqualToString:?

-isEqualTo: is, according to the docs "Declared in NSScriptWhoseTests.h"; this appears to be a part of Foundation, but has some extra (presumably scripting) baggage that I do not pretend to understand:

During the evaluation of an NSWhoseSpecifier object that contains a test whose operator is NSEqualToComparison, an isEqualTo: message may be sent to each potentially specified object, if neither the potentially specified object nor the object being tested against implements a scriptingIsEqualTo: method.


Is there a reason to use it in the case that one might instead use - isEqual: or, as was discussed in a recent thread, -isEqualToString: (which was stated, if I recall correctly, to be optimized for speed in the case of strings)?

Apologies once again for the tangent, but I am rather curious. I am extremely grateful for any insight.

Cheers,
        Andrew

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list ([email protected])

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