Adding a footer to a table in another view?
Posted
by cannyboy
on Stack Overflow
See other posts from Stack Overflow
or by cannyboy
Published on 2010-05-24T09:31:43Z
Indexed on
2010/05/24
9:51 UTC
Read the original article
Hit count: 209
The app I'm making has a settings view which I want to show on the first run of the app.
Normally (after the first run) this view will be pushed onto the screen and there will be a "Back" button in the nav bar.
However, on first launch I don't want there to be a back button. Instead, I want to add a 'Done' button at the footer of the table... and then the view can be popped.
Here's my code (in my initial view's viewDidLoad). I have removed the back button, but don't know how to add the footer and button.
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
if ([prefs stringForKey:@"firstRun"] == nil)
{
SettingsViewController *settingsView = [[SettingsViewController alloc] initWithNibName:@"SettingsView" bundle:nil];
settingsView.hidesBottomBarWhenPushed = YES;
settingsView.navigationItem.hidesBackButton = TRUE;
// add footer button here?
[[self navigationController] pushViewController:settingsView animated:YES];
[settingsView release];
[prefs setObject:@"OK" forKey:@"firstRun"];
} else {
//something
}
© Stack Overflow or respective owner