How does prepareWithInvocationTarget work?
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