• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Why does [someObj msgA:@"xyx"] not give my expected result
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Why does [someObj msgA:@"xyx"] not give my expected result
      • From: "stephen joseph butler" <email@hidden>
  • Prev by Date: Re: NSTrackingArea + cursorUpdate: problem
  • Next by Date: Re: Why does [someObj msgA:@"xyx"] not give my expected result
  • Previous by thread: removing item from NSTreeController or NSOutlineView
  • Next by thread: Re: Why does [someObj msgA:@"xyx"] not give my expected result
  • Index(es):
    • Date
    • Thread