In your view controller
- (void)viewDidLoad{
self.numberpadDonehelper = [[[DZNumberpadDoneHelper alloc] initWithTarget:self doneAction:@selector(doneAction:)] autorelease];
}
- (void)doneAction:(id)sender{
NSLog(@"Done");
}
- (void)viewDidUnload{
self.numberpadDonehelper = nil;
}
- (void)viewWillAppear:(BOOL)animated{
[self.numberpadDonehelper registerObservers];
}
- (void)viewDidDisappear:(BOOL)animated{
[self.numberpadDonehelper unRegisterObservers];
}
All credit belongs to paraches, I just refactor his code a little bit for easy of use.