//Set all cancel buttons in search bars to "Done"
id searchBarButton = [UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil];
if([[[UIDevice currentDevice] systemVersion] floatValue] < 7) {
[searchBarButton setTitle:@"Done"];
} else {
//Can't do anything here or i get EXC_BAD_ACCESS
}
This is giving a EXC_BAD_ACCESS when called in viewDidLoad
only on iOS 7 Gold Master and newer. iOS 7 beta 6 and older is fine.
Is there a different way to do this in iOS 7?
NSLog("%@", searchBarButton)
results in this on iOS7:
2013-10-01 16:14:25.972 MP Staging[12293:a0b] <_UIBarItemAppearance:0x1aaf72d0> <Customizable class: UIBarButtonItem> when contained in (
UISearchBar
) with invocations (null)>
and this on iOS 6
<_UIBarItemAppearance: 0x1c671aa0>