iPhone应用程序中的UIWindow实例化在哪里? [英] Where is the UIWindow instantiated in an iPhone app?

查看:76
本文介绍了iPhone应用程序中的UIWindow实例化在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您从iPhoneSDK中的基于视图模板创建应用程序时,将生成以下代码。我基本上了解这里发生了什么,但是我看不到实例化window和viewController的位置。有帮助吗?

When you create an application from the "View-Based" template in the iPhoneSDK the following code is generated. I basically understand what is happening here, but I do not see where window and viewController are instantiated. 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


推荐答案

它们来自您项目中的MainWindow.xib(或类似文件)。

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

这是在info.plist中设置为应用程序窗口的文件。当您的应用程序启动时,将加载该xib,并且未存档和加载viewcontroller和窗口。

This is the file that in your info.plist is set as the application window. When your application starts this xib is loaded and the viewcontroller and window are unarchived and loaded.

这篇关于iPhone应用程序中的UIWindow实例化在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆