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

Re: Re: KVO and the observeValueForKeyPath bottleneck


  • Subject: Re: Re: KVO and the observeValueForKeyPath bottleneck
  • From: "Michael Ash" <email@hidden>
  • Date: Mon, 17 Jul 2006 14:11:41 -0400

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

> 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.

Delegation and notifications actually behave completely oppositely in this respect. If you fail to implement a delegate method then nothing happens except the object uses the default behavior. If you fail to implement a notification method (one you explicitly signed up for, not one that you get "for free" as part of being a delegate) then you get a nice runtime exception when the notification is sent.

Since this case is much more analogous to notifications than
delegation, getting the exception is probably the right approach.

Mike
_______________________________________________
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: KVO and the observeValueForKeyPath bottleneck (From: Jakob Olesen <email@hidden>)
 >Re: KVO and the observeValueForKeyPath bottleneck (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: KVO and the observeValueForKeyPath bottleneck
  • Next by Date: Re : Newbie Q : using a framework
  • Previous by thread: Re: KVO and the observeValueForKeyPath bottleneck
  • Next by thread: Re: KVO and the observeValueForKeyPath bottleneck
  • Index(es):
    • Date
    • Thread