I am creating an iPad version of Master Detail Application using XCode 4.5 with ARC. I have my iPadMaster.h/.m(as my master) and iPadDetailViewController.h/m(as my detail) set up.
I am trying to load different view controllers from iPadDetailViewController when users click/select the rows on iPadMaster.
On iPadDetailController.h, i set this:
@property int itemNumber;
On iPadMaster.h, i called it as:
@class iPadDetailViewController;
and proceeded with this:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
DetailViewController * DVC = [[DetailViewController alloc]init];
DVC.itemNumber = indexPath.row;
}
On iPadDetailViewController, i set this:
- (void)configureView
{
switch (_itemNumber) {
case 1:
{
iPadLogin *next = [[iPadLogin alloc] init];
NSMutableArray *mut = [[NSMutableArray alloc]init];
mut = [self.splitViewController.viewControllers mutableCopy];
[mut replaceObjectAtIndex:1 withObject:next];
self.splitViewController.viewControllers = mut;
break;
}
default:{
self.view.backgroundColor = [UIColor whiteColor];
}
break;
}
}
//then i called it on:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self configureView];
}
When i clicked the second row in the master table, item_number should be 1 and load the 'iPadLogin' but nothing happens... Any pointers is much appreciated...
Thanx in advance...