国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > iOS > 正文

IOS初始化控制器的實現方法總結

2020-07-26 02:40:06
字體:
來源:轉載
供稿:網友

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

如有疑問請留言或者到本站社區交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 壶关县| 武定县| 江门市| 湖北省| 仙桃市| 山东省| 洪湖市| 罗田县| 华池县| 白银市| 阜康市| 西和县| 锦州市| 美姑县| 龙胜| 常山县| 漳浦县| 北宁市| 阿拉善右旗| 通许县| 龙南县| 丹东市| 合山市| 荆门市| 乌鲁木齐县| 兴海县| 三亚市| 田林县| 会同县| 沙河市| 武隆县| 连州市| 农安县| 建宁县| 墨竹工卡县| 家居| 永年县| 青铜峡市| 涟源市| 鸡西市| 德安县|