Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // ViewController.h
- // hello
- //
- // Created by Morten Ydefeldt on 10/13/11.
- // Copyright (c) 2011 Aalborg University. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- @interface ViewController : UIViewController
- @property (strong, nonatomic) IBOutlet UILabel *mainLabel;
- -(IBAction)DisplayMessage:(id)sender;
- @end
- <VIEWCONTROLLER M START>
- //
- // ViewController.m
- // hello
- //
- // Created by Morten Ydefeldt on 10/13/11.
- // Copyright (c) 2011 Aalborg University. All rights reserved.
- //
- #import "ViewController.h"
- @implementation ViewController
- @synthesize mainLabel;
- - (IBAction)DisplayMessage:(id)sender
- {
- if (mainLabel.text == @"123")
- {
- mainLabel.text = @"loool";
- }
- if (mainLabel.text == @"loool") {
- mainLabel.text = @"123";
- }
- }
- - (void)didReceiveMemoryWarning
- {
- [super didReceiveMemoryWarning];
- // Release any cached data, images, etc that aren't in use.
- }
- #pragma mark - View lifecycle
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- // Do any additional setup after loading the view, typically from a nib.
- }
- - (void)viewDidUnload
- {
- [self setMainLabel:nil];
- [super viewDidUnload];
- // Release any retained subviews of the main view.
- // e.g. self.myOutlet = nil;
- }
- - (void)viewWillAppear:(BOOL)animated
- {
- [super viewWillAppear:animated];
- }
- - (void)viewDidAppear:(BOOL)animated
- {
- [super viewDidAppear:animated];
- }
- - (void)viewWillDisappear:(BOOL)animated
- {
- [super viewWillDisappear:animated];
- }
- - (void)viewDidDisappear:(BOOL)animated
- {
- [super viewDidDisappear:animated];
- }
- - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
- {
- // Return YES for supported orientations
- return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
- }
- @end
Add Comment
Please, Sign In to add comment