when you start your app using single view template, and you add the NSLog(@"self.window = %@", self.window);
in your first line of the AppDelegate.m's application: didFinishLaunchingWithOptions:
method, you can see that self.window
exists in your app.
However, when you start your app using empty template, and tried to log the self.window
to the console, the result returns null
. Even if you add storyboard and a view controller, and set its view controller as the initial view controller, and attempt to log the self.window
, the result is the same - its value is set to null
.
And note that whichever way you take, you can find you declare @property (strong, nonatomic) UIWindow *window;
in AppDelegate.h by default. So I wonder why in the first case, you can see that self.window
is initialized and set the value but not in the latter case. Also, if self.window
is already declared and initialized in the first case but NOT in the second case, how can I find the initialization code?
It looks like in both cases, the @property
declaration is same - and in both cases, as I mentioned, I tried to log the value of self.window
in the FIRST LINE of the AppDelegate.m
's application: didFinishLaunchingWithOptions:
method.
So anything that I'm missing? I don't know why those two cases act differently despite me not finding any differences in both code and storyboard.
I use iOS 7 and Xcode 5. Thanks.