-1

我用 Xcode v6.1.1 编码

我有两个课程:报告和管理员。当我们在报告中(第一个视图)时,我点击管理按钮,然后出现管理视图(第二个视图)。当我点击退出按钮(在管理员视图中)时,我希望管理员视图消失并返回报告。

我不知道我是否在代码中出错,但 NSLog 从 prepareForUnwind 中出现。Unwind segue 出现在情节提要中并链接到“exit”。展开segue标识符:“unwindToContainerVC”操作:prepareForUnwind:

这是我的代码:

管理员.h:

#import <UIKit/UIKit.h>
#import "Reports.h"

@interface Admin : UIViewController

-(IBAction)prepareForUnwind:(UIStoryboardSegue *)segue;

@end

管理员:

#import "Admin.h"


@interface Admin ()

@end

@implementation Admin

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(IBAction)prepareForUnwind:(UIStoryboardSegue *)segue {
    NSLog(@"Called unwind action");
}




@end

我必须在 Reports.h 或 Reports.m 中添加一些内容吗?谢谢 !

4

1 回答 1

0

您是否将退出按钮连接到情节提要中的“退出”动作?

确保您遵循此处的所有说明:使用 Unwind Segues

于 2015-01-12T17:37:21.320 回答