我一直在试图弄清为什么后退按钮不会显示。在我的tableview(这是动态填充)我有Xcode 6添加后退按钮
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//NSString *continent = [self tableView:tableView titleForHeaderInSection:indexPath.section];
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:
@"Main" bundle:[NSBundle mainBundle]];
UIViewController *myController = [storyboard instantiateViewControllerWithIdentifier:@"EditProfileController"];
[self presentViewController:myController animated:YES completion:nil];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
这工作发现,我可以打开一个名为EditProfileController视图。在我的EditProfileController.m我有这
#import "EditProfileController.h"
@interface EditProfileController()
@end
@implementation EditProfileController
- (void)viewDidLoad {
[super viewDidLoad];
UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"back" style:UIBarButtonItemStylePlain target:self action:@selector(Back)];
self.navigationItem.leftBarButtonItem = backButton;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)Back
{
[self dismissViewControllerAnimated:YES completion:nil]; // ios 6
}
@end
我希望看到后退按钮,但没有显示。
这里是故事板