• 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
NSTextField "Discard Change"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextField "Discard Change"


  • Subject: NSTextField "Discard Change"
  • From: Richard Charles <email@hidden>
  • Date: Fri, 05 Apr 2019 21:55:00 -0600

In a document window enter garbage into a text field and press return. An alert
panel will be presented as a sheet attached to the window. In the alert panel
the user can choose "Discard Change" or "OK".

So far so good.

In my case I have a text field subclass with a derived value custom binding.
The text field implements the NSErrorRecoveryAttempting informal protocol.

- (void)attemptRecoveryFromError:(NSError *)error
                     optionIndex:(NSUInteger)recoveryOptionIndex
                        delegate:(id)delegate
              didRecoverSelector:(SEL)didRecoverSelector
                     contextInfo:(void *)contextInfo
{
    // Discard Change
    if (recoveryOptionIndex == 1) {
        [self abortEditing]; // does not work
    }
}

Sending the text field an abortEditing message does not work. How can changes
to the text field be discarded?

--Richard Charles

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSTextField "Discard Change"
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Re: NSTabViewItem and NSViewController
  • Next by Date: Dynamically change NSCollectionView items based on view width
  • Previous by thread: Re: Re: NSTabViewItem and NSViewController
  • Next by thread: Re: NSTextField "Discard Change"
  • Index(es):
    • Date
    • Thread