Created
June 15, 2010 19:06
-
-
Save ejknapp/439536 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // OutletActionDemoViewController.m | |
| // OutletActionDemo | |
| // | |
| // Created by Eric Knapp on 6/15/10. | |
| // Copyright __MyCompanyName__ 2010. All rights reserved. | |
| // | |
| #import "OutletActionDemoViewController.h" | |
| @implementation OutletActionDemoViewController | |
| @synthesize myLabel; | |
| - (BOOL)textFieldShouldReturn:(UITextField *)textField { | |
| NSLog(@"In textFieldShouldReturn"); | |
| self.myLabel.text = textField.text; | |
| textField.text = @""; | |
| [textField resignFirstResponder]; | |
| return YES; | |
| } | |
| -(IBAction)clickTheButton { | |
| NSLog(@"In clickTheButton"); | |
| self.myLabel.text = @"Something New"; | |
| } | |
| /* | |
| // The designated initializer. Override to perform setup that is required before the view is loaded. | |
| - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { | |
| if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { | |
| // Custom initialization | |
| } | |
| return self; | |
| } | |
| */ | |
| /* | |
| // Implement loadView to create a view hierarchy programmatically, without using a nib. | |
| - (void)loadView { | |
| } | |
| */ | |
| // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. | |
| - (void)viewDidLoad { | |
| self.myLabel.text = @"Hello, world."; | |
| [super viewDidLoad]; | |
| } | |
| /* | |
| // Override to allow orientations other than the default portrait orientation. | |
| - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { | |
| // Return YES for supported orientations | |
| return (interfaceOrientation == UIInterfaceOrientationPortrait); | |
| } | |
| */ | |
| - (void)didReceiveMemoryWarning { | |
| // Releases the view if it doesn't have a superview. | |
| [super didReceiveMemoryWarning]; | |
| // Release any cached data, images, etc that aren't in use. | |
| } | |
| - (void)viewDidUnload { | |
| // Release any retained subviews of the main view. | |
| // e.g. self.myOutlet = nil; | |
| } | |
| - (void)dealloc { | |
| [myLabel release]; | |
| [super dealloc]; | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment