iphone - accessing the navigation controller from separate delegate class -
I'm a tutorial follwing a book and there are different representative data source controller (MyViewController.m) < the / p> in order to understand, I no longer representative of a controller pop to class (MyViewDelegate.m) Of course this will not work since the NIT controller sits in the app delegate. But how do I navacroller from delegate class I can use best?
[self setDataSource: [[MyViewDataSource alloc] [self setDelegate: [[MyViewDelegate alloc]
- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath {2ndViewController * controller = [[2ndViewController alloc]]; [[Nav NavController] pushViewController: Animated Controller: Yes];
You can do something like However, you do more with myself should ask is why you need to do and if better way to MVC (Model View Controller) and rules of Encapsulation. For example ,
Uaiawhiajintrniyntrk * Navientrolr = [(Mappelgate *) [[UIApplication ShareApp] Rep] navigation controller];
UIViewController
has been described by the documentation as submitted designate a property is navigationController
, which, given the view controller The appropriate navigation controller will return.
Comments
Post a Comment