iOS開發(fā)調用SearchBar報錯:
?Access to UISearchBar's _searchField ivar is prohibited. This is an application bug'
出現原因: iOS 13 系統(tǒng)禁止通過 KVC 訪問一些方式
UITextField*textfield = [searchBarvalueForKey:@"_searchField"];[textfieldsetValue:KFont(12)forKeyPath:@"_placeholderLabel.font"];
解決辦法:
UITextField*textfield = [searchBarvalueForKey:@"searchField"];[textfieldsetValue:KFont(12)forKeyPath:@"placeholderLabel.font"];