我有很多`UIViewController。实施例
UIViewController 0 - FirstView
我在.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 - MainMenu
我在.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
似乎我正在为一个ViewController(MainMenuViewController)使用多个模态,对吧?我如何解决它。请帮我解决我的问题。