On Wednesday, March 14, 2001, at 09:30 PM, [EMAIL PROTECTED] wrote:
> isEqual: doesn't work to compare a NSString and a NSNumber.
> NSString* a=[NSString stringWithString:@"1"];
> NSNumber* b=[NSNumber numberWIthInti:1];
> [a isEqual:b]] or [b isEqual:a] always return NO
> It's hard to diagnostic until you print the class of the compared objectss
> How does this is handled on NeXT/MacOSX ?
Not a bug ...
This is correct behavior as a string is not a number so isEqual: should always
return NO for a comparison of the two.
In general, objects of different classes are not equal ... unless both are instances
of private subclasses in a class cluster.
OPENSTEP and MacOS-X behave the same way.
_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep