gpt4 book ai didi

IOS初始化控制器的实现方法总结

转载 作者:qq735679552 更新时间:2022-09-27 22:32:09 26 4
gpt4 key购买 nike

CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界.

这篇CFSDN的博客文章IOS初始化控制器的实现方法总结由作者收集整理,如果你对这篇文章有兴趣,记得点赞哟.

IOS初始化控制器的实现方法总结 。

一.ViewControllViewController方法 。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#import "AppDelegate.h"
#import "ViewController.h"
 
@interface AppDelegate ()
 
@property(nonatomic,strong) ViewController *viewController;
 
@end
 
@implementation AppDelegate
 
 
- ( BOOL )application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
 
   //初始化控制器
   self.viewController = [[ViewController alloc]init];
   //初始化window
   self.window =[[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
   //设置控制器
   self.window.rootViewController = self.viewController;
 
   return YES;
}

二 .ViewControllViewController 与 xib方法 。

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#import "AppDelegate.h"
 
#import "XibViewControllViewController.h"
 
@interface AppDelegate ()
 
@property(nonatomic,strong) ViewController *viewController;
@property(nonatomic,strong) XibViewControllViewController *xibControllViewController;
 
@end
 
@implementation AppDelegate
 
 
- ( BOOL )application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
 
   //初始化控制器
   self.xibControllViewController = [[XibViewControllViewController alloc]initWithNibName:@ "XibViewControllViewController" bundle:nil];
   //初始化window
   self.window =[[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
   //设置控制器
   self.window.rootViewController = self.xibControllViewController;
 
 
   return YES;
}

如有疑问请留言或者到本站社区交流讨论,感谢阅读,希望能帮助到大家,谢谢大家对本站的支持! 。

原文链接:http://blog.csdn.net/zl18603543572/article/details/76040059 。

最后此篇关于IOS初始化控制器的实现方法总结的文章就讲到这里了,如果你想了解更多关于IOS初始化控制器的实现方法总结的内容请搜索CFSDN的文章或继续浏览相关文章,希望大家以后支持我的博客! 。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com