I tried this to add UITextField to a UIToolbar but got a run-time error with reason as: [UITextField view]: unrecognized selector sent to instance ...
[toolbar setItems:[NSArray arrayWithObjects:textField, nil]];
toolbar is an instance of UIToolbar and textField is an instance of UITextField.