SHARE
TWEET

UITextField isn't working

a guest Mar 29th, 2012 14 Never
  1. @interface practiceViewController : UIViewController <UITextFieldDelegate>
  2. {
  3.     UITextField *userInput;
  4. }
  5. @property (nonatomic, retain, readwrite) UITextField *userInput;
  6. @end
  7.        
  8. -(UITextField *)userInput{
  9. if (userInput == nil) {
  10.  
  11. userInput=[[UITextField alloc]init];
  12. userInput.keyboardType= UIKeyboardTypeNumberPad;
  13. userInput.returnKeyType= UIReturnKeyDone;
  14. userInput.textColor=[ UIColor redColor];
  15. userInput.clearButtonMode= UITextFieldViewModeWhileEditing;
  16. userInput.delegate = self;
  17. }
  18.  
  19. return userInput;
  20.        
  21. int nInput=[[userInput text] intValue];
  22.        
  23. int nInput = [[userInput text] intValue];
  24.        
  25. [self.view addSubview:self.userInput];
RAW Paste Data
Top