Sorry, I am obviously not being clear as I thought I was. I didn't see the need to provide code.
Okay, so, I have created a brand new single view application. I add a new ViewController class called ActiveViewController. In the viewDidLoad block I place a NSLog stating that view did load from ActiveViewController. I do the same in ViewController.m in the viewDidLoad with a NSLog stating that view did load from ViewController.
I create a method called goToActiveViewController which calls the performSegue method, using the identifier I am about to setup in the storyboard.
Back in the viewDidLoad method of ViewController, I add a delayed execution of the new goToActiveViewController method.
In the storyboard I add a new view controller, assign the ActiveViewControler class. Link ViewController to ActiveViewController with a present modally segue. This is the just of it.
When I run the application, after the time per the delayed execution, ActiveViewController loads and displays, I see the log entry in the console, BUT, at the same time see the ViewController NSLog at the same time! And leaving the app running, again after the time specified in the delayed execution, it happens again, both logs, and then again...so this is my overall issue. Why is viewDidLoad being called in the controller which is presenting the new view controller?
I originally thought this was a bug in XCode 8, or perhaps an issue with iOS 10 Beta 1, but still had the issue with Beta 2 for XCode and iOS 10. I then, using Xcode 8, loaded the app on my iPad which I have iOS 9.3.2 on, and same thing! So this ruled out iOS 10. I then recreated the app in XCode 7, and same thing! Something is wrong on my MacBook, obviously.
To proove this theory, I loaded up OS X on my Parallels Desktop app, and proceeded to create the same simple app in a brand new environment, and it worked as expected! So now I know there is something up with my instalation, but what is it? How is this happening?
Here is the final code of the simple app.
ViewController.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
ViewController.m
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"View Did Load from View Controller");
[self performSelector:@selector(goToActiveViewController) withObject:nil afterDelay:3.0];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
-(void)goToActiveViewController {
[self performSegueWithIdentifier:@"activeViewControllerSegue" sender:nil];
}
@end
ActiveViewController.h
#import <UIKit/UIKit.h>
@interface ActiveViewController : ViewController
@end
ActiveViewController.m
#import "ActiveViewController.h"
@interface ActiveViewController ()
@end
@implementation ActiveViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"View Did Load from Active View Controller");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
@end
As you can see, super simple...
What is going on?