I have an app i'm trying to port over to iOS 7. As there are no longer any textfields in iOS 7 UIAlertViews
. (See here) I have to resort to using 2 UIViews
managed by 1 ViewController.
I didn't use nib files and just program the UI from code.
When the app is started, the second UIView
is stacked on top of the first one, it has a UITextField
that takes in a user input. This code works in iOS 7 but does not work on iOS 6 devices.
In an iOS 6 device, when I tap on the textfield in the 2nd UIView
, the keyboard appears. However when I enter something into the textfield, no characters appear. I even tried to NSLog
the characters entered by the keyboard and got NULL
which means no text is entered!
The code is as follows for the primary ViewController:
//View1 : UIView
View1 *aView1;
[aView1 initWithFrame:CGRectMake(20,40,280,200) title:promptMsg]
[self.view addSubview:aView1];
Inside the View1.m:
(id)initWithFrame:(CGRect) aRect title:(NSString*) promptStr{
self = [super initWithFrame:aRect];
UITextField *userField = [[UITextField alloc] initWithFrame:CGRectMake(x,y,a,b)];
[self addSubview:userField];
Does any know what has changed in iOS 7 that 'allows' this behaviour? IS it a bug in iOS 7 or the SDK?