Overriding NSTextView's toggleAutomaticQuoteSubstitution, special considerations?

  • I plan to override NSTextView's toggleAutomaticQuoteSubstitution: to
    handle the toggling myself in such a way that a group of text views in
    the application is notified of the change (I've set up a user defaults
    binding in each one and will just change the user defaults value from
    my override).

    Does that toggle method just reverse the value, or does it do
    something else as well that I need to be aware of, something that
    won't be done when I override and don't call super's implementation?

    I suppose I could pass the reversed value to user defaults *and*
    call's super's implementation with the only ill effect being that the
    setter is called twice, but if it isn't necessary I'd prefer not to.

    ~Phil
  • On Dec 11, 2007, at 12:49 PM, Philip Dow wrote:

    > I plan to override NSTextView's toggleAutomaticQuoteSubstitution: to
    > handle the toggling myself in such a way that a group of text views
    > in the application is notified of the change (I've set up a user
    > defaults binding in each one and will just change the user defaults
    > value from my override).
    >
    > Does that toggle method just reverse the value, or does it do
    > something else as well that I need to be aware of, something that
    > won't be done when I override and don't call super's implementation?
    >
    > I suppose I could pass the reversed value to user defaults *and*
    > call's super's implementation with the only ill effect being that
    > the setter is called twice, but if it isn't necessary I'd prefer not
    > to.

    -toggleAutomaticQuoteSubstitution: is a convenience action method; the
    primitives are the getter/setter pair, -
    isAutomaticQuoteSubstitutionEnabled/-
    setAutomaticQuoteSubstitutionEnabled:.  If all you want to do is
    control the state of quote substitution, you can certainly use the
    getter/setter methods directly to do that--that's what they're there
    for.

    Douglas Davidson
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today