Where is the UIWindow created in the iPhone app?

When you create an application from the View Based on template, the following code is generated in the iPhoneSDK. I basically understand what is happening here, but I don’t see where the instance of the window and the viewController are being created. Any help?

@class jojojViewController;

@interface jojojAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    jojojViewController *viewController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet jojojViewController *viewController;

@end

=================================================

@implementation Test6AppDelegate

@synthesize window,mainView;    

- (void)applicationDidFinishLaunching:(UIApplication *)application {    

    // Override point for customization after application launch
    [window makeKeyAndVisible];
}    

- (void)dealloc {
    [window release];
    [super dealloc];
}
@end
+3
source share
2 answers

They come from the MainWindow.xib file (or similar) in your project.

This is the file that is set as the application window in your info.plist file. When your application starts, this xib loads, and the view manager and window are unpacked and loaded.

+4
source

MainWindow.xib, AppDelegate viewController, nib ( AppDelegate, ).

+1

Source: https://habr.com/ru/post/1704312/


All Articles