Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why does [someObj msgA:@"xyx"] not give my expected result



Folks;

[someObj msgA:@"xyx"];


- (void) msgA:(NSString *)p1 { if ( [p1 isEqualToString:@"xyz"] ) { NSLog("Match"); } else { NSLog("No Match"); } RESULT: No Match


[someObj msgA:[NSString stringWithString@"xyx"]]; RESULT: Match


I realize the 'bad' nature of the calling code, I just want to understand what is going on that makes version 1 not see p1 as an equivalent string. The compiler allows version 1 with no comment and at run time there is no type error when the message is passed.


Clues? Links?
Steve



Best Regards,
Steve



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.