Header not visible in TableView Controller

Discussion in 'iOS Programming' started by martylavender, May 10, 2015.

  1. martylavender macrumors newbie

    Joined:
    May 10, 2015
    #1
    Do I need to declare the header somehow or should self.navigationItem.title display the header in the table view by itself?

    Code:
    
    - (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.items = @[@{@"name" : @"Take out the trash", @"category" : @"Home"}, @{@"name" : @"Go Shopping", @"category" : @"Home"}].mutableCopy;
    
    self.navigationItem.title = @"What needs to be done";
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addNewItem:)];
    }
    
    
     
  2. Dookieman macrumors 6502

    Joined:
    Oct 12, 2009
    #2
    Try

    self.title = @"Whatever you want to say"
     
  3. martylavender thread starter macrumors newbie

    Joined:
    May 10, 2015
    #3
  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    Is this header in the table view or in the navigation bar?

    self.title = @"blah" is how to set the title in the NavBar. There has to be a Navbar and navigation controller for this to work.

    If you want to set the header in the table view that's different.
     
  5. DannyBres macrumors 65816

    DannyBres

    Joined:
    Oct 30, 2007
    Location:
    UK
    #5
    Not a lot of help for you so far in this thread.

    If you UITableViewController in a UINavigationController. If so, setting the title property of the UITableViewController will display the title in the UINavigationController.

    Hope this helps.
     

Share This Page