I have a tabbar, the first tab has HomeViewController
and the second tab has navigationcontroller has two ViewControllers - CheckOutViewController
and PaymentViewController
.
I am trying to add a delegate on PaymentViewController
which allows me to update HomeViewController
.
However, the delegate method on the HomeViewController
is not getting called.
PaymentViewController
@protocol PaymentViewControllerDelegate <NSObject>
@required
-(void)paymentSuccessfull :(BOOL)isSuccessfull;
@end
@interface PaymentViewController
@property (nonatomic, weak) id <PaymentViewControllerDelegate> paymentDelegate;
-(void)orderProcessed
{
[paymentDelegate paymentSuccessfull : YES];
[self.navigationController popToRootViewControllerAnimated :YES];
}
HomeViewController.m
@interface HomeViewController : UIViewController<PaymentViewControllerDelegate>
// I do not know how to assign delegate here in the tabbar
-(void)paymentSuccessfull:(BOOL)isSuccessfull
{
NSLog(@"success");
}