uinavigationcontroller problem
- Get link
- X
- Other Apps
dear all
in sample project ipad, using uisplitviewcontroller , further , uinavigationcontroller in root view controller (left panel of split view pane) on tapping disclosure button of main table, next view (uitableview) comes up.
logic simple should push object of next view class navigation controller. dont understand lacking.
navigation_testappdelegate.m
rootviewcontroller.m is: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; }
and didselectrowatindexpath method (of 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; }
code:- (void)tableview:(uitableview *)atableview didselectrowatindexpath:(nsindexpath *)indexpath { _nav= [[nextview alloc] initwithstyle:uitableviewstyleplain]; // _nav object of class nextview (uitableviewcontroller type) [self.navigationcontroller pushviewcontroller:_nav animated:yes]; }
unable understand on tapping cell of root view controller, why nextview not visible.
um, , question?
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
- Get link
- X
- Other Apps
Comments
Post a Comment