Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. MyMasterController *masterViewController = [[[MyMasterController alloc] initWithDirectory:directoryElement] autorelease];
  2.  
  3. MyDetailController *detailViewController = [[MyDetailController alloc] init];
  4.  
  5.  
  6. masterViewController.detailViewController = detailViewController;
  7.  
  8. UISplitViewController *splitViewController = [[UISplitViewController alloc] init];
  9. splitViewController.viewControllers = @[[[UINavigationController alloc] initWithRootViewController:masterViewController], [[UINavigationController alloc] initWithRootViewController:detailViewController]
  10. ];
  11. splitViewController.delegate = self;
  12.  
  13. - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  14. {
  15. [master some_method]; // how to get ?
  16. }
  17.  
  18. -(void) viewDidLoad {
  19.  
  20. ...
  21. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(someMethod) name:@"DoSomeMethod" object:nil];
  22.  
  23. }
  24.  
  25. -(void) someMethod {
  26.  
  27. ...
  28.  
  29. }
  30.  
  31. - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  32.  
  33. [[NSNotificationCenter defaultCenter] postNotificationName:@"DoSomeMethod" object:nil];
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement