I have a view controller with a delegate method that should be called, but it doesn't?
NotifyingViewController.h
@protocol NotifyingViewControllerDelegate <NSObject>
@required
- (void)iWasAccepted;
@end
@interface NotifyingViewController : UIViewController
@property (nonatomic, weak) id<NotifyingViewControllerDelegate> delegate;
NotifyingViewController.m
-(void)someMethod{
[self.delegate iWasAccepted];
[self dismissViewControllerAnimated:YES completion:nil];
}
NotifiedViewController.h
#import "NotifyingViewController.h"
@interface NotifiedViewController : UIViewController <NotifyingViewControllerDelegate>
NotifiedViewController.m
-(void)iWasAccepted{
[self saveIntoDB];
NSLog(@"DELEGATE RAN");
}
For some reason, the controller that should be notified isn't. The Notifying controller does dismiss meaning the method that alerts the delegate IS run, but the delegate doesn't run the function because it doesn't NSLog. Any ideas why?