2015-07-09 64 views
1

我一直在试图弄清为什么后退按钮不会显示。在我的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 

我希望看到后退按钮,但没有显示。

Here is my storyboard

这里是故事板

回答

0

您需要更换您的设置视图控制器,导航控制器。然后,将设置视图控制器作为导航控制器的根目录。最后,按下编辑视图控制器。

0

选择settingsViewController转到编辑 - >嵌入 - >导航控制器。并使用协议和代表将数据传递给详细视图