課程
/移動開發(fā)
/iOS
/iOS基礎教程之界面初體驗
老師我用xcode7按你說的錄入代碼,沒法實現(xiàn)窗口背景色變紅,而且啟動程序報thread1:singal SIGABRT??
這是怎么回事呀?
2016-03-23
源自:iOS基礎教程之界面初體驗 2-2
正在回答
我用的事xcode 8 ?也是遇到同樣的問題,按照你的方法解決后 出現(xiàn)了新的錯誤?
Unknown receiver ‘ViewController’; did you mean?
Take_It_Easy
老師用的xcode版本較老,最新版xcode中的代碼應該這樣寫
AppDelegate.m文件:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {??? _navigationController=[[UINavigationController alloc]initWithRootViewController:[[ViewController alloc] init]];??? _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];??? _window.rootViewController = _navigationController;??? _window.backgroundColor = [UIColor redColor];??? [_window makeKeyAndVisible];??? return YES;}
AppDelegate.h文件中加入屬性:
@property (strong,nonatomic)UINavigationController *navigationController;
清泓4172801
舉報
看了這么久的控制臺,該換換口味了,讓你體會到界面的神奇所在
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-10-11
我用的事xcode 8 ?也是遇到同樣的問題,按照你的方法解決后 出現(xiàn)了新的錯誤?
Unknown receiver ‘ViewController’; did you mean?
2016-03-25
老師用的xcode版本較老,最新版xcode中的代碼應該這樣寫
AppDelegate.m文件:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
??? _navigationController=[[UINavigationController alloc]initWithRootViewController:[[ViewController alloc] init]];
??? _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
??? _window.rootViewController = _navigationController;
??? _window.backgroundColor = [UIColor redColor];
??? [_window makeKeyAndVisible];
??? return YES;
}
AppDelegate.h文件中加入屬性:
@property (strong,nonatomic)UINavigationController *navigationController;