• 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
NSUndoManager.prepareWithInvocationTarget:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSUndoManager.prepareWithInvocationTarget:


  • Subject: NSUndoManager.prepareWithInvocationTarget:
  • From: Charles Jenkins <email@hidden>
  • Date: Sun, 10 May 2015 09:07:53 -0400

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


  • Follow-Ups:
    • Re: NSUndoManager.prepareWithInvocationTarget:
      • From: Graham Cox <email@hidden>
    • Re: NSUndoManager.prepareWithInvocationTarget:
      • From: Keary Suska <email@hidden>
    • Re: NSUndoManager.prepareWithInvocationTarget:
      • From: Michael Starke <email@hidden>
  • Prev by Date: Re: Rotate a standard Cocoa control?
  • Next by Date: Re: Core Data sync between iOS and Mac apps
  • Previous by thread: Re: Limiting GCD concurrent queues
  • Next by thread: Re: NSUndoManager.prepareWithInvocationTarget:
  • Index(es):
    • Date
    • Thread