我有很多`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 - 进程1
我在 .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
看来我为一个 ViewController (MainMenuViewController) 使用了不止一种模式,对吧?我如何解决它。请帮我解决我的问题。