• 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: KVO and the observeValueForKeyPath bottleneck
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KVO and the observeValueForKeyPath bottleneck


  • Subject: Re: KVO and the observeValueForKeyPath bottleneck
  • From: Matt Neuburg <email@hidden>
  • Date: Mon, 17 Jul 2006 08:31:29 -0700
  • Thread-topic: KVO and the observeValueForKeyPath bottleneck

On or about 7/17/06 7:57 AM, thus spake "Jakob Olesen" <email@hidden>:

>
> On 17/07/2006, at 16.38, Matt Neuburg wrote:
>
>> On or about 7/17/06 3:38 AM, thus spake "Jakob Olesen"
>> <email@hidden>:
>>
>>> - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)
>>> object change:(NSDictionary *)change context:(void *)context
>>> {
>>>      if ([self respondsToSelector:(SEL)context])
>>>          [self performSelector:(SEL)context withObject:change];
>>> }
>>
>> By an incredible coincidence, yesterday (before this reponse
>> arrived at my
>> desk), after considering all the responses I'd gotten, I decided
>> upon an
>> approach and implemented it in my app, and it was word for word,
>> letter for
>> letter identical with this. m.
>
> Cool, then I can get the SCO lawyers to help me sue you :-)
>
> Seriously, is there any reason for checking respondsToSelector?
> Wouldn't it be better to get an exception (or crash) if you mistype
> the selector or somebody else registers you as an observer?

No. That's not how notification (or, for that matter, delegation) behaves.
Both those behaviors are considered perfectly acceptable. m.

--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide - Second Edition!
http://www.amazon.com/gp/product/0596102119
Take Control of Word 2004, Tiger, and more -
http://www.takecontrolbooks.com/tiger-customizing.html
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/



 _______________________________________________
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

  • Follow-Ups:
    • Re: Re: KVO and the observeValueForKeyPath bottleneck
      • From: "Michael Ash" <email@hidden>
References: 
 >Re: KVO and the observeValueForKeyPath bottleneck (From: Jakob Olesen <email@hidden>)

  • Prev by Date: Core Data and PostgreSQL
  • Next by Date: Re: Core Data and PostgreSQL
  • Previous by thread: Re: KVO and the observeValueForKeyPath bottleneck
  • Next by thread: Re: Re: KVO and the observeValueForKeyPath bottleneck
  • Index(es):
    • Date
    • Thread