Instance Method

textFieldAtIndex:

Returns the text field at the given index

Declaration

- (UITextField *)textFieldAtIndex:(NSInteger)textFieldIndex;

Parameters

textFieldIndex

The index of the text field. The text field indices start at 0.

Return Value

The text field specified by index textFieldIndex.

Discussion

The number of text fields present in an alert is dependent on the style of the alert.

Alert Style

Text Fields

UIAlertViewStyleDefault

No user-editable text fields.

UIAlertViewStyleSecureTextInput

A single text field at index 0.

UIAlertViewStylePlainTextInput

A single text field at index 0.

UIAlertViewStyleLoginAndPasswordInput

The login field is at index 0. The password field is at index 1.

If your application attempts to retrieve a text field with an index that is out of bounds, the alert raises an NSRangeException.

See Also

Configuring Buttons

- addButtonWithTitle:

Adds a button to the receiver with the given title.

Deprecated
numberOfButtons

The number of buttons on the alert view.

Deprecated
- buttonTitleAtIndex:

Returns the title of the button at the given index.

Deprecated
cancelButtonIndex

The index number of the cancel button.

Deprecated
firstOtherButtonIndex

The index of the first other button.

Deprecated