Guest User

Untitled

a guest
Oct 6th, 2014
151
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #import "ViewController.h"
  3.  
  4. @interface ViewController ()
  5.  
  6. @end
  7.  
  8. @implementation ViewController
  9.  
  10. -(BOOL)textFieldShouldReturn:(UITextField *)textField {
  11.     if(textField == self.myTextField) {
  12.         [textField resignFirstResponder];
  13.        
  14.        
  15.     }
  16.     return  YES;
  17. }
  18.  
  19. -(IBAction)changeLabelText:(id)sender; {
  20.  
  21.     self.textFromField = self.myTextField.text;
  22.    
  23.     NSString *userString = self.textFromField;
  24.     if ([userString length] == 0){
  25.         userString = @"";
  26.     }
  27.    
  28.  
  29.     [userString] = [userString - 100 * 0,85];
  30.    
  31.     NSString *finalLabelText = [[NSString alloc] initWithFormat:@"%@", userString];
  32.     self.myLabel.text = finalLabelText;
  33.     [self.myTextField resignFirstResponder];
  34.    
  35.  
  36.        
  37.    
  38. }
  39.  
  40. - (void)viewDidLoad
  41. {
  42.     [super viewDidLoad];
  43.     // Do any additional setup after loading the view, typically from a nib.
  44. }
  45.  
  46. - (void)didReceiveMemoryWarning
  47. {
  48.     [super didReceiveMemoryWarning];
  49.     // Dispose of any resources that can be recreated.
  50. }
RAW Paste Data