我已在UIView ..
中以编程方式添加了UITextFieldUITextField *tf = [[UITextField alloc] initWithFrame:CGRectMake(0, (12*(i))+(30*i), screenWidth - 16, 30)];
NSLog(@"Y: %d", (12*(i))+(30*i));
tf.placeholder = [inputTypes objectAtIndex:0][@"label"];
tf.borderStyle = UITextBorderStyleRoundedRect;
//tf.textAlignment=NSTextAlignmentCenter;
tf.tag = [inputTypes objectAtIndex:0][@"remote_id"];
//NSLog(@"KA: %@ ",[inputTypes objectAtIndex:0][@"remote_id"]);
tf.keyboardType = UIKeyboardTypeNumberPad;
[_viewForDynamicFields addSubview:tf];
并希望从该文本字段中访问值...我为此实现了以下代码..
UITextField *t = [_viewForDynamicFields viewWithTag:[inputTypes objectAtIndex:0][@"remote_id"]];
NSString *value = t.text;
它在模拟器或iPhone上工作正常。但在iPad上,它总是返回值参数nil。