Guest User

Untitled

a guest
Feb 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. //
  2. // ViewController.h
  3. // hello
  4. //
  5. // Created by Morten Ydefeldt on 10/13/11.
  6. // Copyright (c) 2011 Aalborg University. All rights reserved.
  7. //
  8.  
  9. #import <UIKit/UIKit.h>
  10.  
  11. @interface ViewController : UIViewController
  12.  
  13.  
  14. @property (strong, nonatomic) IBOutlet UILabel *mainLabel;
  15.  
  16. -(IBAction)DisplayMessage:(id)sender;
  17.  
  18.  
  19. @end
  20.  
  21.  
  22.  
  23.  
  24.  
  25. <VIEWCONTROLLER M START>
  26.  
  27. //
  28. // ViewController.m
  29. // hello
  30. //
  31. // Created by Morten Ydefeldt on 10/13/11.
  32. // Copyright (c) 2011 Aalborg University. All rights reserved.
  33. //
  34.  
  35. #import "ViewController.h"
  36.  
  37. @implementation ViewController
  38. @synthesize mainLabel;
  39.  
  40. - (IBAction)DisplayMessage:(id)sender
  41. {
  42. if (mainLabel.text == @"123")
  43. {
  44. mainLabel.text = @"loool";
  45. }
  46. if (mainLabel.text == @"loool") {
  47. mainLabel.text = @"123";
  48. }
  49.  
  50.  
  51.  
  52.  
  53. }
  54.  
  55. - (void)didReceiveMemoryWarning
  56. {
  57. [super didReceiveMemoryWarning];
  58. // Release any cached data, images, etc that aren't in use.
  59. }
  60.  
  61. #pragma mark - View lifecycle
  62.  
  63. - (void)viewDidLoad
  64. {
  65. [super viewDidLoad];
  66. // Do any additional setup after loading the view, typically from a nib.
  67. }
  68.  
  69. - (void)viewDidUnload
  70. {
  71. [self setMainLabel:nil];
  72. [super viewDidUnload];
  73. // Release any retained subviews of the main view.
  74. // e.g. self.myOutlet = nil;
  75. }
  76.  
  77. - (void)viewWillAppear:(BOOL)animated
  78. {
  79. [super viewWillAppear:animated];
  80. }
  81.  
  82. - (void)viewDidAppear:(BOOL)animated
  83. {
  84. [super viewDidAppear:animated];
  85. }
  86.  
  87. - (void)viewWillDisappear:(BOOL)animated
  88. {
  89. [super viewWillDisappear:animated];
  90. }
  91.  
  92. - (void)viewDidDisappear:(BOOL)animated
  93. {
  94. [super viewDidDisappear:animated];
  95. }
  96.  
  97. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  98. {
  99. // Return YES for supported orientations
  100. return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
  101. }
  102.  
  103. @end
Add Comment
Please, Sign In to add comment