Is it possible to reassign self inside its own class?
I have a form for that class which have okay button and cancel button. If the user click okay, I will only pass its value to another window. However, if I click cancel, I want to return the state of that form to its previous state. So if the user click that form and it contains value, then the user add a field, but he/she decided to click cancel, I want to reassign the previous state of the instance.
I agree with the comment, it will be helpful if you can show more details. But if I understand you correctly, a better way to implement this is creating a bidirectional linked list structure in which each element is a state rather than modifying an instance. So you can treat ok and 'cancel' button as two opposite operators operating on the forward and backward pointers of this linked list. The length of this list is the steps the user can go back with.
Method's parameter 'self' reassigned