
UITextField isn't working
By: a guest on
Mar 29th, 2012 | syntax:
None | size: 0.63 KB | hits: 14 | expires: Never
@interface practiceViewController : UIViewController <UITextFieldDelegate>
{
UITextField *userInput;
}
@property (nonatomic, retain, readwrite) UITextField *userInput;
@end
-(UITextField *)userInput{
if (userInput == nil) {
userInput=[[UITextField alloc]init];
userInput.keyboardType= UIKeyboardTypeNumberPad;
userInput.returnKeyType= UIReturnKeyDone;
userInput.textColor=[ UIColor redColor];
userInput.clearButtonMode= UITextFieldViewModeWhileEditing;
userInput.delegate = self;
}
return userInput;
int nInput=[[userInput text] intValue];
int nInput = [[userInput text] intValue];
[self.view addSubview:self.userInput];