IOS初始化控制器的實(shí)現(xiàn)方法總結(jié)
IOS初始化控制器的實(shí)現(xiàn)方法總結(jié)
一.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];
//設(shè)置控制器
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];
//設(shè)置控制器
self.window.rootViewController = self.xibControllViewController;
return YES;
}
如有疑問(wèn)請(qǐng)留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!
相關(guān)文章
iOS實(shí)現(xiàn)類(lèi)似格瓦拉電影的轉(zhuǎn)場(chǎng)動(dòng)畫(huà)
這篇文章主要給大家介紹了利用iOS如何實(shí)現(xiàn)類(lèi)似格瓦拉電影的轉(zhuǎn)場(chǎng)動(dòng)畫(huà),文中給出了詳細(xì)步驟實(shí)現(xiàn)代碼,對(duì)大家的學(xué)習(xí)和理解很有幫助,有需要的朋友們可以參考借鑒,下面來(lái)一起看看吧。2016-11-11
ios基于UITableViewController實(shí)現(xiàn)列表
這篇文章主要介紹了ios基于UITableViewController實(shí)現(xiàn)列表的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-01-01
iOS實(shí)現(xiàn)動(dòng)態(tài)元素的引導(dǎo)圖效果
這篇文章給大家介紹了iOS實(shí)現(xiàn)動(dòng)態(tài)元素的引導(dǎo)圖效果的步驟,文章給出了示例代碼介紹的很詳細(xì),有需要的朋友們可以參考借鑒,下面來(lái)一起看看吧。2016-09-09
淺析iOS應(yīng)用開(kāi)發(fā)中線(xiàn)程間的通信與線(xiàn)程安全問(wèn)題
這篇文章主要介紹了淺析iOS應(yīng)用開(kāi)發(fā)中線(xiàn)程間的通信與線(xiàn)程安全問(wèn)題,談到了包括互斥鎖的使用等設(shè)計(jì)要點(diǎn),需要的朋友可以參考下2015-11-11
iOS開(kāi)發(fā)之獲取LaunchImage啟動(dòng)圖的實(shí)例
下面小編就為大家分享一篇iOS開(kāi)發(fā)之獲取LaunchImage啟動(dòng)圖的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2017-12-12

