Re: Boggled By Bindings
Re: Boggled By Bindings
- Subject: Re: Boggled By Bindings
- From: Eric Ocean <email@hidden>
- Date: Fri, 1 Oct 2004 08:37:52 -0700
Instead of if ( keyPath == @"arrangedObjects" ), use
if ( [@"arrangedObject" isEqualToString:keyPath] ) {
; // my code here
}
It's faster when comparing strings than isEqual: (string comparison
isn't necessarily cheap).
Regards,
Eric Ocean
On Oct 1, 2004, at 2:03 AM, Christian Brunschen wrote:
On Sep 30, 2004, at 3:55 PM, Jacob Lukas wrote:
if (keyPath == @"arrangedObjects")
You probably don't want to compare NSStrings using '==', as that only
tests for pointer equality, i.e., object _identity_, whereas you want
to check for _object equality_. Use
[@"arrangedObjects" isEqual:keyPath];
instead. :)
Best wishes,
// Christian Brunschen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden