The below code to hide background of UIsearchBar works fine till iOs4.2 but not in iOS4.3 or later.
for (UIView *subview in searchBar.subviews) {
if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")]) {
[subview removeFromSuperview];
break;
}
}
Their is no issue for this code ….but also giving you a alternate solution , replace code of for loop to