Guest User

Untitled

a guest
Nov 19th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. //
  2. // NavViewController.m
  3. // NavTest
  4. //
  5. // Created by Nien-Yi Ho on 8/24/11.
  6. // Copyright 2011 __MyCompanyName__. All rights reserved.
  7. //
  8.  
  9. #import "FirstViewController.h"
  10. #import "SecondViewController.h"
  11.  
  12. @implementation FirstViewController
  13.  
  14. -(IBAction)goToSecondView:(id)sender
  15. {
  16. SecondViewController *secondViewController = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
  17. secondViewController.title = @"Second";
  18. [self.navigationController pushViewController:secondViewController animated:YES];
  19. [secondViewController release];
  20. }
  21.  
  22. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  23. {
  24. self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
  25. if (self) {
  26. // Custom initialization
  27. }
  28. return self;
  29. }
  30.  
  31. - (void)dealloc
  32. {
  33. [super dealloc];
  34. }
  35.  
  36. - (void)didReceiveMemoryWarning
  37. {
  38. // Releases the view if it doesn't have a superview.
  39. [super didReceiveMemoryWarning];
  40.  
  41. // Release any cached data, images, etc that aren't in use.
  42. }
  43.  
  44. #pragma mark - View lifecycle
  45.  
  46. - (void)viewDidLoad
  47. {
  48. [super viewDidLoad];
  49. // Do any additional setup after loading the view from its nib.
  50. }
  51.  
  52. - (void)viewDidUnload
  53. {
  54. [super viewDidUnload];
  55. // Release any retained subviews of the main view.
  56. // e.g. self.myOutlet = nil;
  57. }
  58.  
  59. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  60. {
  61. // Return YES for supported orientations
  62. return (interfaceOrientation == UIInterfaceOrientationPortrait);
  63. }
  64.  
  65. @end
Add Comment
Please, Sign In to add comment