Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

martylavender

macrumors newbie
Original poster
May 10, 2015
2
0
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:)];
}
 

Dookieman

macrumors 6502
Oct 12, 2009
390
67
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:)];
}

Try

self.title = @"Whatever you want to say"
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
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.
 

DannyBres

macrumors 65816
Oct 30, 2007
1,412
6
UK
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.