Hi guys, I have set up a UISplitView controller which deals with multiple detail views programmatically. This is based on the apple example
here
However I am having major issues with getting the toolbar to show up in any of my detail views (and thus the popover)! I get the idea that I am not initializing and adding it to the view correctly (if at all) but none of my attempts are working!
If someone could give me some thoughts/advice/help etc that would be reallyREALLY handy! I have added some code below (yes, I know it is messy.. and well... like I say, I'm really unsure on the way to do this!).
Apologies, I'm not the best person at this iOS programming malarky(!)
CategoriesViewController_iPad.h
Code:
#import <UIKit/UIKit.h>
#import "RootViewController_iPad.h"
@interface CategoriesViewController_iPad : UITableViewController <SubstitutableDetailViewController>
{
UIToolbar *toolbar;
}
@property (nonatomic, retain) UIToolbar *toolbar;
@end
CategoriesViewController_iPad.m
Code:
@synthesize toolbar;
#pragma mark -
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
[self.tableView initWithFrame:self.tableView.frame style:UITableViewStylePlain];
self.navigationItem.title = NSLocalizedString(@"Categories", @"DetailView Categories");
self.view.backgroundColor = [UIColor orangeColor];
[self.view addSubview:toolbar];
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
self.navigationController.toolbarHidden = NO;
self.navigationController.toolbar.barStyle = UIBarStyleDefault;
}
- (void)viewDidUnload
{
[super viewDidUnload];
self.toolbar = nil;
}