• 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
How does prepareWithInvocationTarget work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How does prepareWithInvocationTarget work?


  • Subject: How does prepareWithInvocationTarget work?
  • From: "Peterson Trethewey" <email@hidden>
  • Date: Sat, 6 May 2006 20:44:56 -0700

I recently tracked down a bug in my undo code.  I was calling
prepareWithInvocationTarget and handing the undoManager a message with
a long argument list.  Some arguments were NSObjects and some were
primitive data types.  (Is that allowed?)

Like this:

-(void) setAttributes: . . .  //(lots of arguments of various types)
{
    [[[self undoManager] prepareWithInvocationTarget: self]
setAttirbutes:. . . . ];
    . . .
}

Anyway, what was happening was that the undoManager was retaining some
of the objects but not others, and the problem went away when I moved
the object-typed arguments of setAttributes to the front of the
argument list.

Forgive my objective-c ignorance but how is
prepareWithInvocationTarget even possible?  How does the undo manager
know what to retain?

Thanks,
Peterson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: copying views how to but change 1 w/o changing the other?
  • Next by Date: frameworks
  • Previous by thread: query NSPopupButtonCell (bindings newbie)
  • Next by thread: Re: How does prepareWithInvocationTarget work?
  • Index(es):
    • Date
    • Thread