So just to confirm, you have MESHomeViewController, which is your primary view. From here, you push MESWelcomeViewController onto the stack. MESWelcomeViewController can perform some login stuff, and once complete, calls [self.delegate didLoginUser].
If this is the case, when you initialize the MESWelcomeViewController, you need to set the delegate. You can do this easily in several ways. You could have an init function for MESWelcomeViewController which takes in an id
-(id) init:(id<LoginViewControllerDelegate>)myDelegate {
self = [super init];
if (self){
self.delegate = myDelegate;
etc...
}
}
Alternatively, after creating the MESWelcomeViewController, but before pushing it, set the delegate property
MESWelcomeViewController *welcomeView = [[MESWelcomeViewController alloc] init];
[welcomeView setDelegate:self];
// push view stuff
Edit:
The init function I gave there isn't automatically called, it would have to explicitly be called instead of the default initializer. If you're using storyboards, you probably should be using the alternative of setting the delegate property. I've never used storyboards before, but you should probably be able to do something like this:
MESWelcomeViewController *welcomeView = [self.storyboard instantiateViewControllerWithIdentifier:@"WelcomeVC"];
[welcomeView setDelegate:self];
[self presentModalViewController:welcomeView animated:NO];
Edit 2: Best alternative would be to use notifications instead. Anything that wants to listen adds an observer to the NSNotificationCenter, and when the event occurs, post the notification.
Example:
In MESHomeViewController's initialize or viewDidLoad, put the following:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didLoginUser) name:@"LoginCompleteNotification" object:nil];
Then whenever you complete a login, do the following:
[[NSNotificationCenter defaultCenter] postNotificationName:@"LoginCompleteNotification" object:nil];
Finally, make sure that you stop listening in the Dealloc of anything that was listening
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"LoginCompleteNotification object:nil]