for
(UIView *searchBarSubview in [searchBar subviews])
{
if
([searchBarSubview conformsToProtocol:@protocol(UITextInputTraits)])
{
[(UITextField *)searchBarSubview setReturnKeyType:UIReturnKeyDone];
[(UITextField *)searchBarSubview setEnablesReturnKeyAutomatically:NO];
}
}