when you launch your application using a single presentation template and you add NSLog(@"self.window = %@", self.window); in the first line of the AppDelegate.m application: didFinishLaunchingWithOptions: method, you can see that self.window exists in your application.
However, when you launch your application using an empty template and try to write self.window to the console, the result returns null . Even if you add a storyboard and a view controller and set your view controller as the initial view controller and try to register self.window , the result will be the same - its value will be set to null .
And note that no matter which method you choose, you may find that you are declaring @property (strong, nonatomic) UIWindow *window; in AppDelegate.h by default. Therefore, I wonder why in the first case you can see that self.window initialized and sets a value, but not in the latter case. Also, if self.window already declared and initialized in the first case, but NOT in the second case, how can I find the initialization code?
It appears that in both cases the @property declaration is the same - and in both cases, as I mentioned, I tried to write the value of self.window to the FIRST LINE of the AppDelegate.m application: didFinishLaunchingWithOptions: method.
So, is there anything that I am missing? I do not know why these two cases act differently, despite the fact that I did not find differences in the code and the storyboard.
I am using iOS 7 and Xcode 5. Thanks.
source share