xcode - Why is my app delegate's didFinishLaunchingWithOptions method all of sudden being called AFTER my RootViewController:viewDidLoad method? -
I'm playing with Xcode's iPad SplitView template. Split View-based app for your template automatically generated from two of the many important ways ...
AppNameAppDelegate.m
#pragma mark - #pragma mark application lifecycle - (bool) application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) Override adaptation after launchOptions {// application launch point rootViewController.managedObjectContext = self.managedObjectContext; // Add the view of the view controller to split the window and display. [Add Window Sweeview: Split ViewController.view]; [Window-making and knowledgeable]; Yes come back }
RootViewController.m
#pragma mark - #pragma See lifecycle icon - (void) viewDidLoad {[super ViewDidLoad]; Self.clearSelectionOnViewWillAppear = No; Self.contentSizeForViewInPopover = CGSizeMake (320.0, 600.0); NSError * Error = Zero; If (! [Exclude [[Self-Result Regulators Controller]): & amp; Error] {NSLog (@ "Unsolved Error% @,% @", Error, [Error User Information]); Abortion (); }}
When you build and someone to run the project before making changes, application: didFinishLaunchingWithOptions method is called
RootViewController: ViewDidLoad
The method is called I'm new to iPhone development, but I'm assuming that this is the correct and specific sequence. Then the changes made here ...
- Once I was confirming that everything was working only without modification, I changed the RootViewController code And set up as a subclass of
UIViewController
(instead ofUITableViewController
by default) and related adjustments in the interface builder. I made and ran, everything was still working fine. - Then, I added a UIView (including nothing) to Rutwu IB and when I've made it and ran, then suddenly
RootViewController: viewDidLoad
toApplication: Finished LaunchingWith Option
Method - Any thoughts that happened due to this?
- Any ideas how can I fix this?
I get it to back the way it was working because before, as you can see in the code Required, viewDidLoad method can therefore be set to execute didFinishLauchingWithOptions Depending on the funds rootViewController the managed object Conteks
, which is used to request fetch it.
Thank you very much for your help! I keep playing with
template app say -applicationDidFinishLaunching approach research RootViewController and code . To the window, due to loading the scene, see clearly - seeDidload - ApplicationDefinitional Launching.
ViewDidLoad (indirectly) is called from applicationDidFinishLaunching.
However, as you say, seeDidload is being called before the appDefinition to launch it because you have done something to load the load before the application is called Definition Launching.
Have you added a breakpoint to the viewDidLoad and see Stacktrace to see what is responsible for seeing it
Comments
Post a Comment