Alright, I think I've got it. Instead of cloning, continuing on with the current instance, and then trying to put the saved instance back in, I reversed it and used the clone for what I need to do inside of the method.
On 3 Sep 2012, at 16:50, Wade Preston Shearer <[email protected]> wrote: > You always find something the second after you break down and post to the > group. I've traced it back to the singleton I've made and the issue of > shallow cloning. I don't have an answer yet, but that problem is me wanting > both a singleton and two copies. I can't have both. Curses. > > > On 3 Sep 2012, at 16:02, Wade Preston Shearer <[email protected]> > wrote: > >> I'm stuck and hope someone on the list can help. I have an object. It was >> assigned in a grandparent class. I want to save a copy of the object so that >> I can make changes to it and then revert back to the state when I saved it >> later. Since objects are assigned by reference (oversimplification), to save >> a copy without my changes affecting the copy, I have to clone it. It works >> up to this point. The issue I'm having os "reloading" the saved instance of >> the object. When I try to assign the variable back to the saved version, it >> saves it as a sub-property instead of replacing. >> >> >> Here's some code with comments: >> >> http://d.pr/n/nPxY >> >> >> Here is the output: >> >> http://d.pr/n/mPUn >> >> >> Here is what I wish the output looked like: >> >> http://d.pr/n/kcr4 >> >> >> Any ideas? >> >> >> >> _______________________________________________ >> >> UPHPU mailing list >> [email protected] >> http://uphpu.org/mailman/listinfo/uphpu >> IRC: #uphpu on irc.freenode.net > > > _______________________________________________ > > UPHPU mailing list > [email protected] > http://uphpu.org/mailman/listinfo/uphpu > IRC: #uphpu on irc.freenode.net _______________________________________________ UPHPU mailing list [email protected] http://uphpu.org/mailman/listinfo/uphpu IRC: #uphpu on irc.freenode.net
