AppDelegate:
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
Override point for customization after application launch.
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
self.secondView = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
第一個viewcontroller:
SecondViewController *second=[[SecondViewController alloc] init];
second.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
[self presentViewController:second animated:YES completion:^{}];
第二個:
[self dismissViewControllerAnimated:YES completion:^{}];
出現的錯誤:
Thread 1:Program received signal : "SIGABRT"
xib文件我都有連線
小白,剛開始學IOS,發現書上的版本太舊,現在看別人博客來學習,竟然還出現錯誤,無奈。。。
看到上面的問題和眾位的回答,我算是拋磚引玉吧,對於你這樣的初級學習者可以從官方的例子入手,例子下載地址:xcode--help--documentation and API Reference--在搜索框輸入uicatalog 然後就可以看到例子了,然後點擊open project 然後xcode會自動下載程序,下載後會自動打開,另外這個例子包含基本的控件的使用,有oc何swift兩個版本,希望對你有用