国产探花免费观看_亚洲丰满少妇自慰呻吟_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;}

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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 容城县| 武夷山市| 常熟市| 绥棱县| 京山县| 曲阜市| 保德县| 广德县| 罗田县| 龙门县| 小金县| 都江堰市| 宜川县| 宝兴县| 太康县| 五大连池市| 临夏县| 嘉祥县| 疏附县| 宜阳县| 东乌珠穆沁旗| 嵩明县| 卢龙县| 澄城县| 肃宁县| 洪泽县| 南平市| 洞口县| 博爱县| 连平县| 高安市| 巴东县| 湟源县| 德州市| 丽水市| 眉山市| 丰都县| 安塞县| 保康县| 朝阳县| 金秀|