So i have 2 view controllers, and a want the DOAbrirListaViewController.h to be a Delegate for the AddTaskViewControoler.h, in theory i think i have everything setup, but the methods on the DOAbrirListaView never get called.
DOAbrirViewController.h
#import "AddTaskViewController.h"
@interface DOAbrirListaViewController : UITableViewController <NSFetchedResultsControllerDelegate, UIAlertViewDelegate, AddTaskViewControllerDelegate>
DOAbrirViewController.m
-(void)addTaskDidCancel {
NSLog(@"AddTask Did Cancel");
}
-(void)addTaskDidSave {
NSLog(@"AddTask Did Save");
}
AddTaskViewController.h
@protocol AddTaskViewControllerDelegate
-(void)addTaskDidSave;
-(void)addTaskDidCancel;
@end
@interface AddTaskViewController : UIViewController
@property (nonatomic, weak) id <AddTaskViewControllerDelegate> delegate;
@property (nonatomic, strong) CDMyLists *currentList;
@end
AddTaskViewController.m
- (IBAction)createButton:(id)sender {
[self.delegate addTaskDidSave];
NSLog(@"Create Button");
}
- (IBAction)cancelButton:(id)sender {
[self.delegate addTaskDidCancel];
NSLog(@"Cancel Button");
}
The buttons are clicked but the NSLOG's on the addTaskDidSave
and AddTaskDidCancel
, never get called.