Re: Comparison WTF's
Re: Comparison WTF's
- Subject: Re: Comparison WTF's
- From: Andy Lee <email@hidden>
- Date: Mon, 27 Oct 2008 13:31:20 -0400
On Oct 27, 2008, at 1:12 PM, Waldo Lee Sharvey wrote:
NSString *stringOne = @"0";
NSString *stringTwo = @"0";
BOOL stringsEqual = [stringOne isEqualToString: stringTwo];
The value for stringsEqual repeatedly returned NO.
I then created a new foundation tool project that only contained that
exact same code, and ran it through the debugger. stringsEqual
repeatedly returned as YES.
I wonder if in the first case the compiler might have optimized away
the assignment to stringsEqual? And maybe your optimization settings
are different in the quickie Foundation tool? What if you use NSLog
to print the value instead of inspecting in the debugger?
I don't even know if the compiler would do something like that -- I'm
just flailing for a possible explanation.
--Andy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden