wethu
5/31/2014 - 7:18 AM

appdelegate.m

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    UISplitViewController *split = (UISplitViewController *) self.navigationController.parentViewController;
    
    // This is a UINavigationController
    UIView *detail = [split.viewControllers objectAtIndex:1];
    
    [detail push .. does't exist']
}
#import "AppDelegate.h"
#import "CPNavigationBar.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Setup Core Data.
    
    // Display the main screen.
    CPClientViewController *masterView = [[CPClientViewController alloc] init];
    CPWelcomeView *detailView = [[CPWelcomeView alloc] init];
    
    UINavigationController *leftNavigation = [[UINavigationController alloc]initWithNavigationBarClass:[CPNavigationBar class] toolbarClass:nil];
    UINavigationController *rightNavigation = [[UINavigationController alloc]init];
    
    [rightNavigation setViewControllers:@[detailView]];
 
    leftNavigation.viewControllers = @[masterView];
    UISplitViewController *splitView = [[UISplitViewController alloc] init];
    splitView.viewControllers = [NSArray arrayWithObjects:leftNavigation, rightNavigation, nil];
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.window setRootViewController:splitView];
    
    [self.window makeKeyAndVisible];
    
    return YES;
    
}