2015-07-09 66 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轉到編輯 - >嵌入 - >導航控制器。並使用協議和代表將數據傳遞給詳細視圖