Why does [someObj msgA:@"xyx"] not give my expected result
Why does [someObj msgA:@"xyx"] not give my expected result
- Subject: Why does [someObj msgA:@"xyx"] not give my expected result
- From: Steve Cronin <email@hidden>
- Date: Thu, 29 Nov 2007 00:53:46 -0600
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:
This email sent to email@hidden