NSTextField "Discard Change"
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