IOS如何实现初始化控制器

这篇文章主要介绍了IOS如何实现初始化控制器,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

十载的呼伦贝尔网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。成都全网营销的优势是能够根据用户设备显示端的尺寸不同,自动调整呼伦贝尔建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。创新互联从事“呼伦贝尔网站设计”,“呼伦贝尔网站推广”以来,每个客户项目都认真落实执行。

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

一.ViewControllViewController方法

#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方法

#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;
}

感谢你能够认真阅读完这篇文章,希望小编分享的“IOS如何实现初始化控制器”这篇文章对大家有帮助,同时也希望大家多多支持创新互联,关注创新互联行业资讯频道,更多相关知识等着你来学习!


文章名称:IOS如何实现初始化控制器
分享URL:http://csruizhi.cn/article/pjsdie.html

其他资讯

Copyright © 2007-2024 成都优众联杰科技有限公司 All Rights Reserved 蜀ICP备2024116266号
友情链接: 手机网站制作 成都企业网站设计 成都网站建设公司 成都网站设计 成都网站制作 网站制作 成都商城网站建设 古蔺网站建设 四川成都网站建设 成都网站建设公司 成都定制网站建设 成都网站设计制作公司 成都商城网站建设 重庆企业网站建设 成都网站制作 四川成都网站制作 网站制作公司 成都模版网站建设 成都企业网站制作 广安网站设计 做网站设计 成都营销网站建设