【发布时间】:2012-03-02 14:48:54
【问题描述】:
我通过 presentModalViewController 制作了一个带有视图的应用。
第一个视图是 ViewController.m
#import "secondview.h"
- (IBAction)pushme:(id)sender {
secondview *second = [[secondview alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:second animated:YES];}
第二个视图是secondview.m
#import "thirdview.h"
- (IBAction)dismiss:(id)sender {
[self dismissModalViewControllerAnimated:YES];}
-(IBAction)gohead:(id)sender{
thirdview *third = [[thirdview alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:third animated:YES];}
第三个视图是thirdview.m
- (IBAction)backtomain:(id)sender {
[self dismissModalViewControllerAnimated:YES];}
我的问题是,当我在第三个视图中单击按钮 (backtomain) 时,我想返回第一个视图,而不是第二个视图。那么如何组织 backtomain 函数呢?
谢谢~
【问题讨论】: