Re: NSUndoManager.prepareWithInvocationTarget:
Re: NSUndoManager.prepareWithInvocationTarget:
- Subject: Re: NSUndoManager.prepareWithInvocationTarget:
- From: Michael Starke <email@hidden>
- Date: Sun, 10 May 2015 15:22:04 +0200
My understanding is you call [[NSUndoManger prepareInvokationWithTarget:aTarget] doFoo:foo withBar:bar];
That is, after having registered your target with the preparation message you can send the returned proxy all the messages your object can handle.
What I'm not sure is how memory management is done on the target and its calls.
___m i c h a e l s t a r k e____
geschäftsführer
HicknHack Software GmbH
www.hicknhack-software.com
___k o n t a k t____
+49 (170) 36 86 1 36
email@hidden
___H i c k n H a c k S o f t w a r e G m b H____
geschäftsführer - maik lathan | andreas reischuck | michael starke
bayreuther straße 32
01187 dresden
amtsgericht dresden HRB 30351
sitz - dresden
> On 10.05.2015, at 15:07, Charles Jenkins <email@hidden> wrote:
>
> Am I correct to believe there is NO way to use NSUndoManager.prepareWithInvocationTarget: if your undo method requires a parameter?
>
> I can use any method I want which has no parameter, but any method with parameters gets me the error “AnyObject does not have member named…”
>
> I thought about making a ClosureWrapper object which could have a parameterless method to call any method on a captured object, but since the invocation holds a weak reference, I think any instance of ClosureWrapper would be destroyed immediately after registration, so I didn’t bother trying.
>
> Right now I’m sticking with registerUndoWithTarget:selector:object:, but I’d like to know if there is a good way to use prepareWithInvocationTarget: instead.
>
> —
>
> 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
_______________________________________________
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