Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 1.20 KB  |  hits: 49  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. pushViewController and popToRootViewController
  2. [navigationController pushViewController:_viewController animated:YES];
  3.        
  4. UIButton* backButton = [UIButton buttonWithType:101];
  5. [backButton addTarget:self action:@selector(dismissView:) forControlEvents:UIControlEventTouchUpInside];
  6. [backButton setTitle:@"Done" forState:UIControlStateNormal];
  7.  
  8. UIBarButtonItem* backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
  9.  
  10. self.navigationItem.leftBarButtonItem = backItem;
  11. [backItem release];
  12.        
  13. -(void) dismissView: (id)sender
  14.  
  15. {
  16.     [self.navigationController popToRootViewControllerAnimated:YES];
  17. //[self.navigationController popToViewController:_viewController animated:YES];
  18.  
  19. }
  20.        
  21. -(void) dismissView: (id)sender
  22.  
  23. {
  24.    NSLog(@"Hii....");
  25.     [self.navigationController popToRootViewControllerAnimated:YES];
  26. //[self.navigationController popToViewController:_viewController animated:YES];
  27.  
  28. }
  29.        
  30. UIButton* backButton = [UIButton buttonWithType:101];
  31.        
  32. + (id)buttonWithType:(UIButtonType)buttonType
  33.        
  34. typedef enum {
  35.     UIButtonTypeCustom = 0,
  36.     UIButtonTypeRoundedRect,
  37.     UIButtonTypeDetailDisclosure,
  38.     UIButtonTypeInfoLight,
  39.     UIButtonTypeInfoDark,
  40.     UIButtonTypeContactAdd,
  41. } UIButtonType;