• 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
Re: Returns from a sheet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Returns from a sheet


  • Subject: Re: Returns from a sheet
  • From: Ondra Cada <email@hidden>
  • Date: Fri, 3 May 2002 23:15:32 +0200

On Friday, May 3, 2002, at 10:03 , Donald Brown wrote:

"if (mystr==@"test")" will
never return true, because the pointer to mystr is different than the
pointer to @"test"

Ammm... although with the general attitude I do agree, this one sentence is wrong: the compiler does coalesce strings, and thus

116 /tmp> cat q.m
#import <Foundation/Foundation.h>
int main() {
NSString *s=@"test";
if (s==@"test") printf("Oops!\n");
return 0;
}
117 /tmp> cc -Wall -framework Foundation q.m && ./a.out
Oops!
118 /tmp>
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Returns from a sheet (From: Donald Brown <email@hidden>)

  • Prev by Date: Re: Returns from a sheet
  • Next by Date: Moving objects in NSMutableArray
  • Previous by thread: Re: Returns from a sheet
  • Next by thread: Re: Returns from a sheet
  • Index(es):
    • Date
    • Thread