Kindly note that delegate should not have strong reference.
So use
@property (unsafe_unretained) id <AccountViewControllerDelegate> accountViewDelegate;
Now in MapViewController.m
or MapViewController.h
conform to this protocol as
@interface MapViewController : UIViewController <AccountViewControllerDelegate>{
}
Then in MapViewController.m
please do
AccountViewController *accountVC = [[AccountViewController alloc]init]; // initialize it with whatever be like storyboard or nib
accountVC.accountViewDelegate = self;
Your AccountViewController.h
file should look like this
@protocol AccountViewControllerDelegate <NSObject>
- (void)showLabel;
@end
@interface AccountViewController : UIViewController{
}
@property (unsafe_unretained) id <AccountViewControllerDelegate> accountViewDelegate;
@end