Advertisement
Guest User

UITextField isn't working

a guest
Mar 29th, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  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];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement