Re: Preserving undo actions on deleted targets
Re: Preserving undo actions on deleted targets
- Subject: Re: Preserving undo actions on deleted targets
- From: Graham Cox <email@hidden>
- Date: Thu, 30 Jan 2014 09:44:11 +1100
On 30 Jan 2014, at 8:03 am, Keary Suska <email@hidden> wrote:
> Absolutely, and I have found it invaluable to troubleshoot state issues, but unfortunately it is not App Store safe (read: basis for rejection), as it relies on a private method call for proper NSDocument change tracking...
It does?
I'm using it in an App Store app without it ever having come up as an issue. Have you actually had this flagged as an issue by The Keepers Of The Storeā¢?
If you're referring to:
- (void) _processEndOfEventNotification:(NSNotification*) note
I'm not sure that counts as using private API as such. It's just a stub for a method that NSDocument calls on its undo manager, and as you can see it's only a notification handler (containing no code). It's needed because NSDocument doesn't check whether the undo manager implements it before calling it, so it will cause an unrecognised selector exception if it's not there, but it's not actually calling any private API itself anywhere - NSDocument is.
If you subclassed NSUndoManager, you would be "using" this private method, but since GCUndoManager isn't a subclass, the stub is needed so that the replacement object mimics the original correctly, in accordance with the idea of duck-typing. If anything, Apple should be either checking for the existence of the method before invoking it, or making it public.
--Graham
_______________________________________________
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