uinavigationcontroller problem in uisplitviewcontroller

Joined
Jun 3, 2011
Messages
54
Reaction score
0
Points
6
Dear All

In my sample project for iPad, I am using uisplitviewcontroller and further , uinavigationcontroller in root view controller (left panel of split view pane) so that on tapping the disclosure button of main table, next view (uitableview) comes up.

Logic is simple that I should push the object of next view class to navigation controller. But I dont understand where I am lacking.

Navigation_TestAppDelegate.m
Code:
@synthesize window, splitViewController, rootViewController, detailViewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    
    UINavigationController *rootNav = [[UINavigationController alloc] initWithRootViewController:rootViewController];
	splitViewController.viewControllers = [NSArray arrayWithObjects:rootNav,detailViewController,nil]; 
    splitViewController.delegate = detailViewController;
    [window addSubview:splitViewController.view];
    [window makeKeyAndVisible];
    [rootNav release];
    return YES;
}

RootViewController.m is:

Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"CellIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        cell.accessoryType = UITableViewCellAccessoryNone;
    }
  
    cell.textLabel.text = [NSString stringWithFormat:@"Row %d", indexPath.row];
	cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
    return cell;
}

and didSelectRowAtIndexPath method (of RootViewController.m)is:

Code:
- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
	    _nav= [[nextview alloc] initWithStyle:UITableViewStylePlain];
           // _nav is object of class nextview (uitableviewcontroller type)
	    [self.navigationController pushViewController:_nav animated:YES];
}


I am unable to understand that on tapping cell of root view controller, why nextview is not visible.
 

bobtomay

,
Retired Staff
Joined
Dec 22, 2006
Messages
26,561
Reaction score
677
Points
113
Location
Texas, where else?
Your Mac's Specs
15" MBP '06 2.33 C2D 4GB 10.7; 13" MBA '14 1.8 i7 8GB 10.11; 21" iMac '13 2.9 i5 8GB 10.11; 6S
I don't want to discourage you from posting here. But, it seems to me, you may be able to get faster help in Apple's developer forums.
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
Joined
Feb 25, 2009
Messages
2,112
Reaction score
71
Points
48
Your Mac's Specs
Late 2013 rMBP, i7, 750m gpu, OSX versions 10.9.3, 10.10
If you're tapping the disclosure triangle (which is what you're doing according to your post), you're not selecting a row, which means that tableView:didSelectRowAtIndexPath: will never get called. Instead you need to look to implement: – tableView:accessoryButtonTappedForRowWithIndexPath:
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
Thank all..I was making some mistake in delegate class.

Perhaps you should mention that at that other link. And describe which delegate class.
 
OP
S
Joined
Jun 3, 2011
Messages
54
Reaction score
0
Points
6
@above

I got atleast some reply here. I think No one cared to give some reply there. SO i just informed here..:) :)
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
The replies you got at the other site simply didn't lead anywhere. It is always good form to close off your thread with the answer if you found it, as you did do after my suggestion.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top