am using MFSideMenu for my iphone app to implement a side bar. I have successfully implemented the sidebar. with the following code in my appdelegete
- (ViewController *)demoController {
return [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
}
- (UINavigationController *)navigationController {
return [[UINavigationController alloc]
initWithRootViewController:[self demoController]];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
LeftSlideViewController *leftMenuViewController = [[LeftSlideViewController alloc] init];
MFSideMenuContainerViewController *container = [MFSideMenuContainerViewController
containerWithCenterViewController:[self navigationController]
leftMenuViewController:leftMenuViewController
rightMenuViewController:nil];
container.navigationController.navigationItem.rightBarButtonItem=nil;
self.window.rootViewController = container;
[self.window makeKeyAndVisible];
return YES;
}
Now Let me explain my problem..
I have View-controller name with LeftSideViewController in which there is UITablview And on application starts there is one view-controller as a center view named as "ViewController" I don't need right-side view controller so i dint include that
now I have UITableview in my leftsidecontroller and on click of that UITableview's row i have to change the center view.
My problem is that when i put this code in my leftside view controller's uitableview delegete method as this its not changing my centerview with new view controller
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Load new front view
MFSideMenuContainerViewController *menuController = (MFSideMenuContainerViewController*)((AppDelegate*)[[UIApplication sharedApplication] delegate]).viewController;
PhotoGalleryViewController *SearchBarTableView=[[PhotoGalleryViewController alloc]initWithNibName:@"PhotoGalleryViewController" bundle:nil];
[self.navigationController pushViewController:SearchBarTableView animated:YES];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:SearchBarTableView];
menuController.centerViewController=navController;
//[menuController1 setRootController:navController animated:YES];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
Can anyone please give me some guidance that how to change the views accordingly the leftside view's UITableview row click.