I used the below code to add textfield in UIAlertView. It works fine in Simulator(iOS SDK 5.0) but when i install in device(iOS 4.0.1) i get "Unrecognized selector sent to instance error"

```
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Enter your name" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];

    alert.alertViewStyle = UIAlertViewStylePlainTextInput;

    alert.tag = 9001;

    [alert show];

    [alert release];

```