UIViewController がたくさんあります。例
UIViewController 0 - ファーストビュー
.h ファイルと .m ファイルの両方に #import "MainMenuViewController.h" を追加します。コードを含む私のXIB内のボタン:
- (IBAction)nextBtn:(id)sender
{
MainMenuViewController *mainmenuData = [[MainMenuViewController alloc]initWithNibName:nil bundle:nil];
self.mainmenuView = mainmenuData;
mainmenuView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:mainmenuView animated:YES];
}
UIViewController 1 - メインメニュー
.h ファイルと .m ファイルの両方に #import "Process1ViewController.h" を追加します。コードを含む私のXIB内のボタン:
- (IBAction)nextBtn:(id)sender
{
Process1ViewController *process1Data = [[Process1ViewController alloc]initWithNibName:nil bundle:nil];
self.process1View = process1Data;
process1View.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:process1View animated:YES];
}
UIViewController 2 - Process1
.h ファイルと .m ファイルの両方に #import "Process2ViewController.h" を追加します。コードを含む私のXIB内のボタン:
- (IBAction)nextBtn:(id)sender
{
Process2ViewController *process2Data = [[Process2ViewController alloc]initWithNibName:nil bundle:nil];
self.process2View = process2Data;
process2View.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:process2View animated:YES];
}
UIViewController 3 - Process2
.h ファイルと .m ファイルの両方に #import "ResultViewController.h" を追加します。コードを含む私のXIB内のボタン:
- (IBAction)nextBtn:(id)sender
{
ResultViewController *resultData = [[ResultViewController alloc]initWithNibName:nil bundle:nil];
self.resultView = resultData;
resultView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:resultView animated:YES];
}
UIViewController 4 - 結果
.h ファイルと .m ファイルの両方に #import "MainMenuViewController.h" を追加します。コードを含む私のXIB内のボタン:
- (IBAction)nextBtn:(id)sender
{
MainMenuViewController *mainmenuData = [[MainMenuViewController alloc]initWithNibName:nil bundle:nil];
self.mainmenuView = mainmenuData;
mainmenuView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:mainmenuView animated:YES];
}
ここで、このエラーポイントを ResultViewController.h に取得します:
Unknown type name 'MainMenuViewController'; did you mean 'UIPageViewController'?
- In file included from
/Users/Whatever/Desktop/Project1/Project1/FirstViewController.m:9:
- In file included from
/Users/Whatever/Desktop/Project1/Project1/FirstViewController.h:10:
- In file included from
/Users/Whatever/Desktop/Project1/Project1/../MainMenuViewController.h:10:
- In file included from
/Users/Whatever/Desktop/Project1/Project1/../Process1.h:10:
- In file included from
/Users/Whatever/Desktop/Project1/Project1/../Process1.h:10:
- 'UIPageViewController' declared here
その他のエラー:
Unknown type name 'MainMenuViewController'; did you mean 'FirstViewController'?
- In file included from
/Users/Whatever/Desktop/Project1/Project1/FirstAppDelegate.m:11:
- In file included from
/Users/Whatever/Desktop/Project1/Project1/FirstViewController.h:10:
- In file included from
/Users/Whatever/Desktop/Project1/Project1/../MainMenuViewController.h:10:
- In file included from
/Users/Whatever/Desktop/Project1/Project1/../Process1ViewController.h:10:
- In file included from
/Users/Whatever/Desktop/Project1/Project1/../Process2ViewController.h:10:
- 'FirstViewController' declared here
1つのViewController(MainMenuViewController)に複数のモーダルを使用しているようですよね?どうすれば修正できますか。私の問題を解決するのを手伝ってください。