IOS Note - View Controller(视图控制器)

Application Delegate(应用程序委托)

Application Name: SingleView

SingleViewAppDelegate.h

#import <UIKit/UIKit.h>

@interface SingleViewAppDelegate : UIResponder
    <UIApplicationDelegate>
    
@property (strong, nonatomic) UIWindow *window;

@property (strong, nonatomic) SingleViewViewController *viewController;

@end

SingleViewAppDelegate.m

#import "SingleViewAppDelegate.h"
#import "SingleViewViewController.h"

@implementation SingleViewAppDelegate

@synthesize window = _window;
@synthesize viewController = _viewController;

- (void) dealloc
{
    [_window release];
    [_viewController release];
    [super dealloc];
}

- (BOOL) application: (UIApplication *)application
didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]] autorelease];
    self.viewController = [[[SingleViewViewController alloc]
                            initWithNibName: @"SingleViewViewController"
                            bundle: nil] autorelease];
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    
    return YES;
}

转载于:https://www.cnblogs.com/davidgu/p/3469823.html

猜你喜欢

转载自blog.csdn.net/weixin_33711647/article/details/93802909
今日推荐