• 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: Boggled By Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Re: Boggled By Bindings (From: Christian Brunschen <email@hidden>)

  • Prev by Date: Report Generation
  • Next by Date: NSSecureTextField and IB Bindings
  • Previous by thread: Re: Boggled By Bindings
  • Next by thread: Re: Boggled By Bindings
  • Index(es):
    • Date
    • Thread