I have a function for undo who works good. My app is a photo editor with multiple effect. When i add multiple effect to my photo and i undo all this effect, it works very good BUT when i want add again a filter/effect and i want undo again it don't work. I mean my undo function work only one time.
Can someone tell me why it work only one time ?
there is my function who work :
- (void)updateImage:(UIImage*)Images {
[undoManager registerUndoWithTarget:self selector:@selector(updateImage:) object:Images];
_imageView.image = Images;
}
- (void)pushedUndoBtn:(id)sender
{
[undoManager undo];
}
There is how i reference my undo manager :
@implementation _CLImageEditorViewController
{
NSUndoManager * undoManager;
}
- (void)viewDidLoad
{
[super viewDidLoad];
undoManager = [[NSUndoManager alloc] init];
}