【发布时间】:2017-08-08 22:03:42
【问题描述】:
我正在学习如何创建 unwind segue。我创建了两个 VC,“ViewoController”和“MessageViewController”。第一个包含一个按钮,而后者嵌入在 NavigationController 中,它有两个 barButtons“取消”和“保存”。
据我所知,要创建展开转场,“MessageViewController”中的“取消”和/或“保存”按钮必须链接到其 ViewController 中的“MessageViewController”中的 EXIT 图标。
我遇到的问题是,当我无法将 barButton 链接到 EXIT 图标时
请告诉我如何将 barBurron 链接到 EXIT 图标,以便调用“backToViewController”方法
viewController.m
#import "ViewController.h"
#import "MessageViewController.h"
@interface ViewController ()
@property (strong, nonatomic) IBOutlet UIButton *buttonNext;
@end
@implementation ViewController
- (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.
}
-(void) backToViewController:(UIStoryboardSegue *)segue {
}
@end
messageViewController:
#import "MessageViewController.h"
#import "ViewController.h"
@interface MessageViewController ()
@property (strong, nonatomic) IBOutlet UIBarButtonItem
*barButtonSave;
@property (strong, nonatomic) IBOutlet UIBarButtonItem
*barButtonCancel;
@property (strong, nonatomic) IBOutlet UITextField
*textFieldMessage;
@end
@implementation MessageViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
【问题讨论】:
标签: ios objective-c segue uistoryboardsegue unwind-segue